A RELAX NG validator in Java

Copyright © 2001, 2002 Thai Open Source Software Center Ltd

See the file copying.txt for copying permission.

Version 2003-02-26

This version of Jing implements

The implementation is available for download as

The main class is com.thaiopensource.relaxng.util.Driver. The first argument expected by the main class is the name of the file containing the RELAX NG schema. The second and subsequent arguments are the names of one or more files to be validated against this schema.

Jing accepts the following command-line options:

Uses the compact syntax for the schema.
-e enc
Uses the encoding enc to read the schema.
Checks that the document is feasibly valid. A document is feasibly valid if it could be transformed into a valid document by inserting any number of attributes and child elements anywhere in the tree. This is equivalent to transforming the schema by wrapping every data, list, element and attribute element in an optional element and then validating against the transformed schema. This option may be useful while a document is still under construction. This option also disables checking that for every IDREF there is a corresponding ID.
Disables checking of ID/IDREF/IDREFS. By default, Jing enforces the constraints imposed by RELAX NG DTD Compatibility with respect to ID/IDREF/IDREFS.
Prints the time used by Jing for loading the schema and for validation.

Jing uses a vendor-independent Java interface for RELAX NG datatype libraries, developed by James Clark and KAWAGUCHI Kohsuke and hosted at SourceForge in the relaxng project. Jing can use any datatype library that implements this interface. For more information on creating your own datatype libraries, including a sample, download datatype-sample.zip.

Jing also includes an implementation of a datatype library for the W3C XML Schema Part 2 datatypes. There is a separate document describing this implementation and how to use it.

Jing also supports Modular Namespaces (MNS). No special options are needed for this. Provided that you do not use the -c option, Jing will detect that the schema is an MNS schema rather than a RELAX NG schema. Jing allows MNS schemas to reference schemas in RELAX NG, RELAX NG Compact Syntax and MNS. Note that the design of MNS is not final and is subject to (possibly radical) change. ID/IDREF checking does not work with MNS in the way that it probably should: each validate and validateAttributes element performs ID/IDREF checking completely independently; they probably should share a common table of ID/IDREFs. This behavior may change in a future release.

If you wish to use Jing in your programs, you have a choice.

There is a Jing task that allows Jing to be invoked by the Ant build tool.

James Clark