|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectledge.xml.XMLValidator
public class XMLValidator
Validates XML files against schemata using MSV library.
The primary schema language used throughout ObjectLedge project is RelaxNG, but the MSV library determines the schema languague using XML namespace of the top level element. At the moment XML based schema languages supported by MSV and thus by XMLValidator are RelaxNG, W3C XSD, and others.
| Field Summary | |
|---|---|
private ExceptionErrorHandler |
errorHandler
|
private XMLGrammarCache |
grammarCache
|
static String |
RELAXNG_SCHEMA
Pathname of the relaxng schema. |
private SAXParser |
saxParser
|
| Constructor Summary | |
|---|---|
XMLValidator(XMLGrammarCache grammarCache)
Creates a new instance of the validator. |
|
| Method Summary | |
|---|---|
com.sun.msv.verifier.Verifier |
getVerifier(URL schemaUrl)
Returns a thread-exclusive verifier instance. |
void |
validate(URL fileUrl,
URL schemaUrl)
Validates given XML file using specified schema. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private XMLGrammarCache grammarCache
private SAXParser saxParser
private ExceptionErrorHandler errorHandler
public static final String RELAXNG_SCHEMA
| Constructor Detail |
|---|
public XMLValidator(XMLGrammarCache grammarCache)
throws ParserConfigurationException,
SAXException
grammarCache - system grammar cache for retrieving grammars used for validation
ParserConfigurationException - if the JAXP parser factory is misconfigured.
SAXException - if the JAXP parser factory is misconfigured.| Method Detail |
|---|
public void validate(URL fileUrl,
URL schemaUrl)
throws SAXException,
ParserConfigurationException,
IOException
fileUrl - the URL of the file to be validated.schemaUrl - the URL of the schema to be used.
ParserConfigurationException - if parser is badly configured.
IOException - if the schema does not exist.
SAXException - if the schema is malformed.
public com.sun.msv.verifier.Verifier getVerifier(URL schemaUrl)
throws SAXException,
ParserConfigurationException,
IOException
schemaUrl - the URL of the schema to be used.
ParserConfigurationException - if parser is badly configured.
IOException - if the schema does not exist.
SAXException - if the schema is malformed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||