
Package ca.uhn.fhir.util
Class XmlUtil
java.lang.Object
ca.uhn.fhir.util.XmlUtil
Utility methods for working with the StAX API.
This class contains code adapted from the Apache Axiom project.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic XMLEventReadercreateXmlReader(Reader reader) static XMLStreamWritercreateXmlStreamWriter(Writer theWriter) static XMLEventWritercreateXmlWriter(Writer theWriter) static StringEncode a set of StAX events into a Stringstatic StringencodeDocument(Node theElement) static StringencodeDocument(Node theElement, boolean theIndent) getChildrenByTagName(Element theParent, String theName) Parses an XML string into a set of StAX eventsstatic DocumentparseDocument(Reader reader) static DocumentparseDocument(Reader theReader, boolean theNamespaceAware, boolean allowDoctypeDeclaration) static DocumentparseDocument(String theInput) static voidFOR UNIT TESTS ONLY - Used to reset OutputFactory for test cases that customize OutputFactory
-
Method Details
-
createXmlReader
public static XMLEventReader createXmlReader(Reader reader) throws FactoryConfigurationError, XMLStreamException -
createXmlStreamWriter
public static XMLStreamWriter createXmlStreamWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException -
createXmlWriter
public static XMLEventWriter createXmlWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException -
encode
Encode a set of StAX events into a String -
parse
Parses an XML string into a set of StAX events -
parseDocument
- Throws:
IOExceptionSAXException
-
parseDocument
- Throws:
SAXExceptionIOException
-
parseDocument
public static Document parseDocument(Reader theReader, boolean theNamespaceAware, boolean allowDoctypeDeclaration) throws SAXException, IOException - Throws:
SAXExceptionIOException
-
getChildrenByTagName
-
encodeDocument
- Throws:
TransformerException
-
encodeDocument
- Throws:
TransformerException
-
resetOutputFactoryForTest
FOR UNIT TESTS ONLY - Used to reset OutputFactory for test cases that customize OutputFactory
-