public final class XMLConverter extends Object
HL7Messages to and from XML.| Modifier and Type | Field and Description |
|---|---|
static String |
HL7_NAMESPACE_URI
HL7 message XML namespace.
|
static String |
HL7_TAG
XML tag name used by
toXML(org.dellroad.hl7.HL7Message, boolean). |
static String |
MESSAGE_TAG
XML tag name used for one XML-encoded message.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
appendMessage(Node parent,
HL7Message message,
boolean omitEmpty)
Convert a message to XML and append it to the given element.
|
static void |
appendMessage(XMLStreamWriter writer,
HL7Message message,
boolean omitEmpty)
Convert a message to XML and append it to the given
XMLStreamWriter. |
static void |
appendSegment(Node parent,
HL7Segment segment,
boolean omitEmpty)
Convert a segment to XML and append it to the given element.
|
static void |
appendSegment(XMLStreamWriter writer,
HL7Segment segment,
boolean omitEmpty)
Convert a segment to XML and write it to the given
XMLStreamWriter. |
static Document |
createDocument()
Create an empty XML document for HL7 messages.
|
static void |
main(String[] args)
Test routine.
|
static void |
stream(Document doc,
OutputStream out)
Serialize the XML document and write it to the given output.
|
static void |
stream(TransformerFactory transformerFactory,
Document doc,
OutputStream out)
Serialize the XML document and write it to the given output.
|
static Document |
toXML(HL7Message message,
boolean omitEmpty)
Convert an HL7 message message to an XML document.
|
public static final String HL7_NAMESPACE_URI
public static final String HL7_TAG
toXML(org.dellroad.hl7.HL7Message, boolean).public static final String MESSAGE_TAG
public static Document createDocument()
public static Document toXML(HL7Message message, boolean omitEmpty)
message - HL7 messageomitEmpty - Omit empty tags (other than the last one)public static void appendMessage(Node parent, HL7Message message, boolean omitEmpty)
public static void appendMessage(XMLStreamWriter writer, HL7Message message, boolean omitEmpty) throws XMLStreamException
XMLStreamWriter.writer - XML outputmessage - HL7 message to appendomitEmpty - Omit empty tags (other than the last one)XMLStreamException - if an XML error occurspublic static void appendSegment(Node parent, HL7Segment segment, boolean omitEmpty)
public static void appendSegment(XMLStreamWriter writer, HL7Segment segment, boolean omitEmpty) throws XMLStreamException
XMLStreamWriter.writer - XML outputsegment - HL7 segment to appendomitEmpty - Omit empty tags (other than the last one)XMLStreamException - if an XML error occurspublic static void stream(Document doc, OutputStream out) throws IOException
doc - XML document to outputout - output desinationIOException - if an I/O error occurspublic static void stream(TransformerFactory transformerFactory, Document doc, OutputStream out) throws IOException
transformerFactory - factory for XSL transformersdoc - XML document to outputout - output desinationIOException - if an I/O error occursCopyright © 2018. All rights reserved.