The xjparse library provides a convenient wrapper for running W3C
XML Schema validation with Xerces.
Usage: java [java options] com.nwalsh.parsers.XJParse [parser options] doc.xml
Where [parser options] are:
-ccatalogFile to load a particular XML Catalog-vto perform a (DTD) validating parse-sto enable W3C XML Schema validation-Sschema.xsd to use schema.xsd for validation, implies-s-fto enable full schema checking, implies-s-nto perform a namespace-ignorant parse-Einteger to specify the maximum number of errors to display-dto enable debug mode; show stack trace on errors-qto use quiet mode; validation warning and error messages suppressed
The process ends with error-level 1 if there are errors, 0 otherwise.
There are two jar files:
xjparse-app-X.Y.Z.jarcontains the application classes and all of the dependencies. You can run the application directly out of this jar file.xjparse-X.Y.Z.jarcontains only the application classes; to use it, you’ll need to put the dependencies on your class path. (Look inbuild.gradlefor the current set of dependencies.)
Running the following command:
java -jar xjparse-app-3.0.0.jar -f -S src/test/resources/schema/doc.xsd src/test/resources/docs/sample.xml
will demonstrate the results.
If you have questions or comments about xjparse, please visit
http://github.com/ndw/xjparse for contact details or to report issues.