The xjparse tool is a simple command-line wrapper for the Xerces XML Schema validator. It accepts several options, notably one which specifies the set of schemas to be used during validation.
The xjparse 1.0 jar file and sources are available.
In order to use xjparse, you must have the xjparse jar file, the Xerces implementation (often xercesImpl.jar), and the catalog resolver (often resolver.jar) from the Apache xml-commons project on your class path.
Usage: java com.nwalsh.parsers.xjparse options filename
Where options are:
Load a particular catalog file
Perform a well-formed parse, not a validating parse
Perform a validating parse (the default)
Enable W3C XML Schema validation. Only ordinary XML parsing (perhaps with DTD-based validation) is performed if this option is not specified (or implied).
Use schema.xsd for validation (implies -s). This option can be specified more than once.
Enable full schema checking (implies -s). With this option, Xerces examines the schemas more aggressively for errors. It has no direct effect on the validation performed.
Perform a namespace-ignorant parse. Has no effect if schema processing is enabled.
Perform a namespace-aware parse (the default)
Set the debug level (warnings are level 2)
Set the maximum number of errors to display. Note that error reporting relies on the org.apache.xml.resolver.apps.XParseError class. Some distributions of the resolver have a bug in this class which causes the error reporting to be inaccurate.
Share and enjoy!