public final class ValidatorExtensions extends Object
ValidatorExtensions can validate xml files.| Constructor and Description |
|---|
ValidatorExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static DocumentBuilderFactory |
getDocumentBuilderFactory(String schema)
Gets the document builder factory.
|
static DOMSource |
getDOMSource(File xml,
ErrorHandler errorHandler)
Gets the dOM source.
|
static Schema |
getSchema(File xsd,
ErrorHandler errorHandler)
Gets the schema.
|
static Document |
parse(File xml,
ErrorHandler errorHandler)
Parses the.
|
static void |
validateSchema(File xsd,
File xml,
ErrorHandler errorHandler)
Validate xml through xsd.
|
static boolean |
validateSchema(String SchemaUrl,
String XmlDocumentUrl)
Validate given xml schema.
|
public static DocumentBuilderFactory getDocumentBuilderFactory(String schema)
schema - the schemapublic static DOMSource getDOMSource(File xml, ErrorHandler errorHandler) throws SAXException, ParserConfigurationException, IOException
xml - the xmlerrorHandler - the error handlerSAXException - If a SAX error occurs during parsing.ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
requested.IOException - Signals that an I/O exception has occurred.public static Schema getSchema(File xsd, ErrorHandler errorHandler) throws SAXException
xsd - the xsderrorHandler - the error handlerSAXException - If a SAX error occurs during parsing.public static Document parse(File xml, ErrorHandler errorHandler) throws SAXException, ParserConfigurationException, IOException
xml - the xmlerrorHandler - the error handlerSAXException - If a SAX error occurs during parsing.ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
requested.IOException - Signals that an I/O exception has occurred.public static void validateSchema(File xsd, File xml, ErrorHandler errorHandler) throws SAXException, ParserConfigurationException, IOException
xsd - the xsdxml - the xmlerrorHandler - the error handlerSAXException - If a SAX error occurs during parsing.ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
requested.IOException - Signals that an I/O exception has occurred.public static boolean validateSchema(String SchemaUrl, String XmlDocumentUrl) throws SAXException, ParserConfigurationException, IOException
SchemaUrl - the schema urlXmlDocumentUrl - the xml document urlSAXException - If a SAX error occurs during parsing.ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
requested.IOException - Signals that an I/O exception has occurred.Copyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.