[nw] nwalsh.com

xjparse

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.

Version 1.0

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:

-c catalogfile

Load a particular catalog file

-w

Perform a well-formed parse, not a validating parse

-v

Perform a validating parse (the default)

-s

Enable W3C XML Schema validation. Only ordinary XML parsing (perhaps with DTD-based validation) is performed if this option is not specified (or implied).

-S schema.xsd

Use schema.xsd for validation (implies -s). This option can be specified more than once.

-f

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.

-n

Perform a namespace-ignorant parse. Has no effect if schema processing is enabled.

-N

Perform a namespace-aware parse (the default)

-d integer

Set the debug level (warnings are level 2)

-E integer

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!