public final class DomUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.List<org.w3c.dom.Element> |
getChildElements(org.w3c.dom.Node node,
java.lang.String name) |
static boolean |
validateAgainst(org.w3c.dom.Node docOrEl,
java.lang.String xsdFile)
Validate a document/element tree against an external XSD file.
|
static boolean |
validateAgainstInternalSchema(org.w3c.dom.Node docOrEl)
Validate a document/element tree against a XSD schema referenced in the XML itself.
|
public static boolean validateAgainst(org.w3c.dom.Node docOrEl, java.lang.String xsdFile)
docOrEl
- XML document or element to be validatedxsdFile
- Path to an XSD schema filejava.lang.IllegalArgumentException
- if the schema cannot be loadedpublic static boolean validateAgainstInternalSchema(org.w3c.dom.Node docOrEl)
docOrEl
- XML document or element to be validatedpublic 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.