public final class ValidatorExtensions
extends java.lang.Object
ValidatorExtensions can validate xml files.| Constructor and Description |
|---|
ValidatorExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static javax.xml.parsers.DocumentBuilderFactory |
getDocumentBuilderFactory(java.lang.String schema)
Gets the document builder factory.
|
static javax.xml.transform.dom.DOMSource |
getDOMSource(java.io.File xml,
org.xml.sax.ErrorHandler errorHandler)
Gets the dOM source.
|
static javax.xml.validation.Schema |
getSchema(java.io.File xsd,
org.xml.sax.ErrorHandler errorHandler)
Gets the schema.
|
static org.w3c.dom.Document |
parse(java.io.File xml,
org.xml.sax.ErrorHandler errorHandler)
Parses the.
|
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.
|
public static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilderFactory(java.lang.String schema)
schema - the schemapublic static javax.xml.transform.dom.DOMSource getDOMSource(java.io.File xml,
org.xml.sax.ErrorHandler errorHandler)
throws org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException,
java.io.IOException
xml - the xmlerrorHandler - the error handlerorg.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.public static javax.xml.validation.Schema getSchema(java.io.File xsd,
org.xml.sax.ErrorHandler errorHandler)
throws org.xml.sax.SAXException
xsd - the xsderrorHandler - the error handlerorg.xml.sax.SAXException - If a SAX error occurs during parsing.public static org.w3c.dom.Document parse(java.io.File xml,
org.xml.sax.ErrorHandler errorHandler)
throws org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException,
java.io.IOException
xml - the xmlerrorHandler - the error handlerorg.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.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
xsd - the xsdxml - the xmlerrorHandler - the error handlerorg.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.public static boolean validateSchema(java.lang.String SchemaUrl,
java.lang.String XmlDocumentUrl)
throws org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException,
java.io.IOException
SchemaUrl - the schema urlXmlDocumentUrl - the xml document urlorg.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.