Package play.libs
Class XML
java.lang.Object
play.libs.XML
XML utilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classIncludes the SAX prefixes from 'com.sun.org.apache.xerces.internal.impl.Constants' since they will likely be internal in JDK9 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentfromInputSource(InputSource source) Parses the input source as DOM.static DocumentfromInputStream(InputStream in, String encoding) Parses an InputStream as DOM.static DocumentfromString(String xml) Parses an XML string as DOM.static ByteStringConverts the document to bytes.
-
Constructor Details
-
XML
public XML()
-
-
Method Details
-
fromString
Parses an XML string as DOM.- Parameters:
xml- the input XML string- Returns:
- the parsed XML DOM root.
-
fromInputStream
Parses an InputStream as DOM.- Parameters:
in- the inputstream to parse.encoding- the encoding of the input stream, if not null.- Returns:
- the parsed XML DOM.
-
fromInputSource
Parses the input source as DOM.- Parameters:
source- The source to parse.- Returns:
- The Document.
-
toBytes
Converts the document to bytes.- Parameters:
document- The document to convert.- Returns:
- The ByteString representation of the document.
-