- java.lang.Object
-
- io.github.astrapi69.xml.parser.ValidatorExtensions
-
public final class ValidatorExtensions extends java.lang.Object
The classValidatorExtensions
can validate xml files
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
validateSchema(java.io.File xsd, java.io.File xml, org.xml.sax.ErrorHandler errorHandler)
Validate xml through xsd.static boolean
validateSchema(java.lang.String schemaUrl, java.lang.String xmlDocumentUrl)
Validate given xml schema.
-
-
-
Method Detail
-
validateSchema
public static void validateSchema(java.io.File xsd, java.io.File xml, org.xml.sax.ErrorHandler errorHandler) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
Validate xml through xsd.- Parameters:
xsd
- the xsdxml
- the xmlerrorHandler
- the error handler- Throws:
org.xml.sax.SAXException
- If a SAX error occurs during parsing.javax.xml.parsers.ParserConfigurationException
- if a DocumentBuilder cannot be created which satisfies the configuration requested.java.io.IOException
- Signals that an I/O exception has occurred.
-
validateSchema
public static boolean validateSchema(java.lang.String schemaUrl, java.lang.String xmlDocumentUrl) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
Validate given xml schema.- Parameters:
schemaUrl
- the schema urlxmlDocumentUrl
- the xml document url- Returns:
- true if the given xml is valid otherwise false
- Throws:
org.xml.sax.SAXException
- If a SAX error occurs during parsing.javax.xml.parsers.ParserConfigurationException
- if a DocumentBuilder cannot be created which satisfies the configuration requested.java.io.IOException
- Signals that an I/O exception has occurred.
-
-