public final class XmlUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static InputSource |
fromXmlString(String xml)
Create an
InputSource from an XML string. |
static <A extends Node> |
iterable(NodeList nl)
Make a
NodeList iterable. |
static Document |
newDocument()
Creates an xml document root and returns it.
|
static Either<Exception,Document> |
parse(InputSource src)
Parsing of
src without namespaces. |
static Either<Exception,Document> |
parseNs(InputSource src)
Namespace aware parsing of
src. |
static Either<Exception,Document> |
parseNs(String xml)
Namespace aware parsing of
xml. |
static InputStream |
serializeDocument(Document document)
Writes an xml representation to an input stream and return it.
|
static void |
toXml(Document doc,
OutputStream out)
Writes an xml representation to a stream.
|
static String |
toXmlString(Document document)
Serializes the document to a XML string
|
public static Either<Exception,Document> parseNs(InputSource src)
src.public static Either<Exception,Document> parseNs(String xml)
xml.public static Either<Exception,Document> parse(InputSource src)
src without namespaces.public static void toXml(Document doc, OutputStream out) throws IOException
doc - the documentout - the output streamIOException - if there is an error transforming the dom to a streampublic static InputStream serializeDocument(Document document) throws IOException
document - the documentIOException - if there is an error transforming the dom to a streampublic static String toXmlString(Document document) throws IOException
document - the documentIOException - if there is an error transforming the dom to a streampublic static InputSource fromXmlString(String xml)
InputSource from an XML string.public static Document newDocument()
Copyright © 2009–2020 Opencast Project. All rights reserved.