java.lang.Object
esa.opensf.osfi.XMLParser
Deprecated.
XMLParser.
XML file builder and parser. Uses the W3C DOM.
XML file builder and parser. Uses the W3C DOM.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.This class has been "renamed"XmlParseExceptionto reduce namespace clutter -
Method Summary
Modifier and TypeMethodDescriptiongetChildElements(Node node, String name) Deprecated.Given a DOM Node, returns all the direct children elements with the given name.static DocumentDeprecated.Read and parse a XML document, without validation.static DocumentDeprecated.Due to the convoluted behaviour (to validate against internal schema a non-null but blank file has to be passed).static booleanvalidateAgainst(Node docOrEl, String xsdFile) Deprecated.Validate a document/element tree against an external XSD file.static booleanvalidateAgainstInternalSchema(Node docOrEl) Deprecated.Validate a document/element tree against a XSD schema referenced in the XML itself.
-
Method Details
-
read
@Deprecated(since="3.9.2") public static Document read(String xmlFile, String xsdFile) throws FileNotFoundException, XmlParseException Deprecated.Due to the convoluted behaviour (to validate against internal schema a non-null but blank file has to be passed).Reads a XML file (optionally validating it against a XSD schema) and creates a DOM document.- Parameters:
xmlFile- XML file locationxsdFile- XSD file location. Null if not needed- Returns:
- The parsed DOM Document.
- Throws:
FileNotFoundExceptionXmlParseException
-
read
Deprecated.Read and parse a XML document, without validation.- Throws:
FileNotFoundException- if the file cannot be loaded.XmlParseException- if the XML cannot be parsed to a DOM document.
-
validateAgainst
Deprecated.Validate a document/element tree against an external XSD file.- Returns:
- true if the validation succeeds, false otherwise.
- Throws:
IllegalArgumentException- if the schema cannot be loaded
-
validateAgainstInternalSchema
Deprecated.Validate a document/element tree against a XSD schema referenced in the XML itself.- Returns:
- true if the validation succeeds, false otherwise.
-
getChildElements
Deprecated.Given a DOM Node, returns all the direct children elements with the given name.- 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.
-
XmlFilesandDomUtilsto reduce clutter