Package play.libs
Class XML
- Object
-
- play.libs.XML
-
public final class XML extends Object
XML utilities.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXML.ConstantsIncludes the SAX prefixes from 'com.sun.org.apache.xerces.internal.impl.Constants' since they will likely be internal in JDK9
-
Constructor Summary
Constructors Constructor Description XML()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 ByteStringtoBytes(Document document)Converts the document to bytes.
-
-
-
Method Detail
-
fromString
public static Document fromString(String xml)
Parses an XML string as DOM.- Parameters:
xml- the input XML string- Returns:
- the parsed XML DOM root.
-
fromInputStream
public static Document fromInputStream(InputStream in, String encoding)
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
public static Document fromInputSource(InputSource source)
Parses the input source as DOM.- Parameters:
source- The source to parse.- Returns:
- The Document.
-
toBytes
public static ByteString toBytes(Document document)
Converts the document to bytes.- Parameters:
document- The document to convert.- Returns:
- The ByteString representation of the document.
-
-