public class ParseUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static nu.xom.Document |
readXmlStream(java.io.InputStream inputStream,
java.lang.String baseURI,
java.lang.String rootElement,
java.lang.String systemId,
java.lang.String resourceName,
org.xml.sax.ErrorHandler errorHandler)
Reads an XML file.
|
static nu.xom.Document |
readXmlUrl(java.net.URL url,
java.lang.String rootElement,
java.lang.String systemId,
java.lang.String resourceName,
org.xml.sax.ErrorHandler errorHandler)
Reads an XML file from an
URL . |
@NotNull public static nu.xom.Document readXmlUrl(@NotNull java.net.URL url, @NotNull java.lang.String rootElement, @NotNull java.lang.String systemId, @NotNull java.lang.String resourceName, @Nullable org.xml.sax.ErrorHandler errorHandler) throws java.io.IOException, nu.xom.ParsingException, org.xml.sax.SAXException, java.net.URISyntaxException, nu.xom.xinclude.XIncludeException
URL
.url
- the URL to readrootElement
- the tag name of the root element in the DOCTYPE
declarationsystemId
- the system ID of the doctype declarationresourceName
- the name of the resource that contains the DTD
contentserrorHandler
- the error handler to use or null
java.io.IOException
- if the XML file cannot be readnu.xom.ParsingException
- if parsing the XML file failsorg.xml.sax.SAXException
- the parsing the XML file failsjava.net.URISyntaxException
- if an include cannot be resolvednu.xom.xinclude.XIncludeException
- if parsing of the XML file fails@NotNull public static nu.xom.Document readXmlStream(@NotNull java.io.InputStream inputStream, @NotNull java.lang.String baseURI, @NotNull java.lang.String rootElement, @NotNull java.lang.String systemId, @NotNull java.lang.String resourceName, @Nullable org.xml.sax.ErrorHandler errorHandler) throws java.io.IOException, nu.xom.ParsingException, org.xml.sax.SAXException, nu.xom.xinclude.XIncludeException
inputStream
- the XML file to readbaseURI
- the base URI for resolving includesrootElement
- the tag name of the root element in the DOCTYPE
declarationsystemId
- the system ID of the doctype declarationresourceName
- the name of the resource that contains the DTD
contentserrorHandler
- the error handler to use or null
java.io.IOException
- if the XML file cannot be readnu.xom.ParsingException
- if parsing the XML file failsorg.xml.sax.SAXException
- the parsing the XML file failsnu.xom.xinclude.XIncludeException
- if parsing of the XML file fails