4. Command line tools

4.1. rngvalid

Rngvalid is a script which is used to invoke the version of Jing included in XXE (relaxng.jar).

Usage: rngvalid ?options? relax_ng_schema ?xml_document ... xml_document?

Validate documents xml_document ... xml_document against schema relax_ng_schema. If documents are not specified, just validate the schema.

Options are (what follows is copied from the documentation of Jing):

-c

The schema uses RELAX NG Compact Syntax.

-e enc

Uses the encoding enc to read the schema.

-f

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.

-i

Disables checking of ID/IDREF/IDREFS. By default, Jing enforces the constraints imposed by RELAX NG DTD Compatibility with respect to ID/IDREF/IDREFS.

-t

Prints the time used by Jing for loading the schema and for validation.

Examples:

C:\Program Files\XMLmind_XML_Editor> rngvalid demo\bugreport\bugreport.rng

C:\Program Files\XMLmind_XML_Editor> rngvalid demo\bugreport\bugreport.rng \
    demo\bugreport_rng.xml

C:\Program Files\XMLmind_XML_Editor> rngvalid -c doc\rngsupport\samples\target.rnc

C:\Program Files\XMLmind_XML_Editor> rngvalid -c doc\rngsupport\samples\target.rnc \
    doc\rngsupport\samples\target_good.xml doc\rngsupport\samples\target_bad.xml

4.2. rngdoc

Rngdoc can be used to generate an HTML reference manual for a RELAX NG schema.

The generated HTML reference manual, organized like "DocBook: The Definitive Guide" by Norman Walsh and al., lists all elements and attributes specified in the schema.

This manual is intended to help content authors create instances conforming to a given RELAX NG schema. This manual is not intended to help schema authors document their design.

Usage: rngdoc ?options? relax_ng_schema out_dir

Generate an HTML reference manual for schema relax_ng_schema in directory out_dir.

Options are:

-rnc

Specifies that relax_ng_schema uses the compact syntax. Default: XML syntax.

-rncencoding rnc_charset

Specifies the character encoding of the schema using the compact syntax. Default: platform default encoding.

-css CSS_URL

Specifies which CSS style sheet to use in the generated HTML. Default: no CSS.

-charset html_charset

Specifies the character encoding of the generated HTML. Default: platform default encoding.

-xxe

Add annotations which are useful when the RELAX NG schema is used by XMLmind XML Editor. Default: don't annotate.

Example:

C:\Program Files\XMLmind_XML_Editor> rngdoc -xxe demo\bugreport\bugreport.rng C:\temp