java.lang.Object
esa.opensf.osfi.xmlutils.DomUtils
Utility class with methods that work on DOM nodes, documents and elements.
-
Method Summary
Modifier and TypeMethodDescriptiongetChildElements(Node node, String name) static booleanvalidateAgainst(Node docOrEl, String xsdFile) Validate a document/element tree against an external XSD file.static booleanvalidateAgainstInternalSchema(Node docOrEl) Validate a document/element tree against a XSD schema referenced in the XML itself.
-
Method Details
-
validateAgainst
Validate a document/element tree against an external XSD file.- Parameters:
docOrEl- XML document or element to be validatedxsdFile- Path to an XSD schema file- Returns:
- true if the validation succeeds, false otherwise.
- Throws:
IllegalArgumentException- if the schema cannot be loaded
-
validateAgainstInternalSchema
Validate a document/element tree against a XSD schema referenced in the XML itself.- Parameters:
docOrEl- XML document or element to be validated- Returns:
- true if the validation succeeds, false otherwise.
-
getChildElements
- Parameters:
node- Node whose direct children will be filteredname- String that will be checked against theNode.getNodeName()value. If null, all direct child elements will be returned.- Returns:
- List of all the direct children elements with the given tag name
-