@Deprecated
public final class XMLParser
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XMLParser.ParseException
Deprecated.
This class has been "renamed"
XmlParseException
to reduce namespace clutter |
Modifier and Type | Method and Description |
---|---|
static java.util.List<org.w3c.dom.Element> |
getChildElements(org.w3c.dom.Node node,
java.lang.String name)
Deprecated.
Given a DOM Node, returns all the direct children elements with the given name.
|
static org.w3c.dom.Document |
read(java.lang.String xmlFile)
Deprecated.
Read and parse a XML document, without validation.
|
static org.w3c.dom.Document |
read(java.lang.String xmlFile,
java.lang.String xsdFile)
Deprecated.
Due to the convoluted behaviour (to validate against internal schema a non-null
but blank file has to be passed).
|
static boolean |
validateAgainst(org.w3c.dom.Node docOrEl,
java.lang.String xsdFile)
Deprecated.
Validate a document/element tree against an external XSD file.
|
static boolean |
validateAgainstInternalSchema(org.w3c.dom.Node docOrEl)
Deprecated.
Validate a document/element tree against a XSD schema referenced in the XML itself.
|
public static org.w3c.dom.Document read(java.lang.String xmlFile, java.lang.String xsdFile) throws java.io.FileNotFoundException, XmlParseException
xmlFile
- XML file locationxsdFile
- XSD file location. Null if not neededjava.io.FileNotFoundException
XmlParseException
public static org.w3c.dom.Document read(java.lang.String xmlFile) throws java.io.FileNotFoundException, XmlParseException
java.io.FileNotFoundException
- if the file cannot be loaded.XmlParseException
- if the XML cannot be parsed to a DOM document.public static boolean validateAgainst(org.w3c.dom.Node docOrEl, java.lang.String xsdFile)
java.lang.IllegalArgumentException
- if the schema cannot be loadedpublic static boolean validateAgainstInternalSchema(org.w3c.dom.Node docOrEl)
public static java.util.List<org.w3c.dom.Element> getChildElements(org.w3c.dom.Node node, java.lang.String name)
node
- Node whose direct children will be filteredname
- String that will be checked against the Node.getNodeName()
value.
If null, all direct child elements will be returned.