6. Schvalid command reference

schvalid ?-v? ?-iso? ?-nons? schema ?-write out_schema? ?-phase phase_id? ?-var name value ... -var name value? ?xml_doc ... xml_doc?

Validate specified XML documents against specified Schematron schema. Optionally validate the schema as an ISO Schematron.

This command supports both ISO Schematron and Schematron 1.5. It cannot validate a Schematron 1.5 schema. However it can load a Schematron 1.5 schema and use it for instance validation.

Unless the -iso option, which forces schema validation, is used, the schematron (ISO or 1.5) may be embedded in another type of XML document (e.g. a DocBook 5 RELAX NG grammar, but not using the compact syntax).

Options:

-v

Turns verbosity on.

-iso

Fully validate schema as being an ISO Schematron schema.

Default: do not validate schema. Just load it.

Note that, unless this schema validation option is turned on, the Schematron loader is very lenient and accepts ISO Schematron as well as Schematron 1.5 schemas.

-nons

When loading the schema, accept unknown namespace prefixes. That is, interpret foo:bar as being {}foo:bar and not as being {unknown_namespace}bar.

This may be needed for documents conforming to a DTD because in such case, the document is not namespace aware.

-write out_schema

Write loaded schema to specified file. The written schema is in all cases an ISO Schematron schema using the minimal syntax.

-phase phase_id

Specifies the ID of the phase which is to be used for validation. May also be #ALL or #DEFAULT.

Default: #DEFAULT, if any, #ALL otherwise.

-var name value

Specify overrides for some of the let variables defined in the schematron.

Note that value must be a valid XPath expression and not a plain string (e.g. "'Hello world'" and not just "Hello world").

This command is XML catalog aware. This command will use the XML catalogs specified in environment variable XML_CATALOG_FILES. This variable must contain one or several XML catalog file names or URLs separated by a semi-colon (';').

XML catalogs may be used to resolve URLs found in sch:include elements.

Examples: