Contents

1 The xsdvalid toolset distribution
2 Install
2.1 Installing xsdvalid
2.1.1 Requirements
2.1.2 Install on Unix
2.1.3 Install on Windows
2.2 Content of the installation directory
3 Xsdvalid command reference
3.1 About the generated documentation
4 Dtdvalid command reference
5 Dtdtoxsd command reference
6 Implementation limits
6.1 Limitations related to XML Schema Datatypes
6.2 Limitations related to XML Schema Structures
6.3 Limitations related to DTD support
7 Enhancements and bug fixes
7.1 V3.0 Patch 1 (December 2, 2005)
7.2 V2.11 (July 11, 2005)
7.3 V2.10 (June 2, 2005)
7.4 V2.9 Patch 1 (April 4, 2005)
7.5 V2.9 (February 7, 2005)
7.6 V2.6 Patch 1 (June 18, 2004)
7.7 V2.6 (May 10, 2004)
7.8 V2.5 Patch 3 (March 10, 2004)
7.9 V2.5 Patch 1 (December 15, 2003)
7.10 V2.5 (November 04, 2003)
7.11 V2.4 (August 13, 2003)
7.12 V2.0 Beta 1 (September 3, 2002)
7.13 V1.0 Patch 3 (August 19, 2002)
7.14 V1.0 Patch 2 (July 29, 2002)
7.15 V1.0 Patch 1 (April 25, 2002)
7.16 V1.0 (January 9, 2002)

This guide describes three command-line tools for use by DTD and W3C XML Schema authors: xsdvalid, dtdvalid and dtdtoxsd. It is also a good reference for the support of DTD and W3C XML Schema in XXE.

1 The xsdvalid toolset distributionContents

This distribution contains the W3C XML Schema validation engine which is integrated in XMLmind XML Editor (XXE).

This engine has been made available to schema and DTD authors in the form of 3 command-line tools:

xsdvalid
Checks an XML schema for validity. Checks an XML document for validity against an XML schema.
dtdvalid
Checks a DTD for validity. Checks an XML document for validity against a DTD.
dtdtoxsd
Converts a DTD to an XML schema.

Features:

Non features:

2 InstallContents

2.1 Installing xsdvalidContents

2.1.1 RequirementsContents

Xsdvalid tools have been tested with:

2.1.2 Install on UnixContents

Procedure:

  1. Make sure that the Java[tm] bin/ directory is referenced in the $PATH and, at the same time, check that the Java[tm] runtime in the $PATH has the right version:
    $ java -version
    java version "1.5.0_04"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)
  2. Unpack the xsdvalid distribution somewhere.
    $ cd 
    $ tar zxvf xsdvalid-30.tar.gz
    $ ls xsdvalid-30
    bin/
    doc/
  3. Xsdvalid tools are intended to be used directly from the xsdvalid-30/ directory. That is, you can add xsdvalid-30/bin/ to your $PATH.
    $ xsdvalid-30/bin/xsdvalid -s my_w3c_xml_schema.xsd

2.1.3 Install on WindowsContents

Manual install on Windows is similar to the install on Unix. Simply run xsdvalid-30\bin\xsdvalid.bat, dtdvalid.bat, dtdtoxsd.bat rather than the xsdvalid-30/bin/xsdvalid, dtdvalid, dtdtoxsd shell scripts.

2.2 Content of the installation directoryContents

doc/xsdvalid
Contains this user guide.
doc/xsdvalid/samples/xsdvalid
Contains some files that can be used to quickly test xsdvalid. The examples given in the xsdvalid command reference section below make use of the files found in this directory.
doc/xsdvalid/samples/dtdvalid
Contains some files that can be used to quickly test dtdvalid and dtdtoxsd. The examples given in the dtdvalid and dtdtoxsd command reference sections below make use of the files found in this directory.
bin/xsdvalid, dtdvalid, dtdtoxsd, xsdvalid.bat, dtdvalid.bat, dtdtoxsd.bat
Scripts used to run xsdvalid, dtdvalid and dtdtoxsd. Use xsdvalid, dtdvalid and dtdtoxsd on any Unix system. Use xsdvalid.bat, dtdvalid.bat and dtdtoxsd.bat on Windows.
bin/*.jar
All the (non-system) Java class libraries needed to run xsdvalid, dtdvalid and dtdtoxsd:

3 Xsdvalid command referenceContents

xsdvalid ?options? ?xml_doc ... xml_doc?

Checks an XML schema for validity. Checks an XML document for validity against an XML schema.

Options:

-o file
Generate report in file file. Default: output report to console.
-s schema
Use schema schema to validate XML documents. Default: use what is specified by xsi:schemaLocation and xsi:noNamespaceSchemaLocation.
-ss namespace schema
Same as -s except that first parameter specifies the target namespace of the schema. This target namespace is mandatory if the schema is to be deserialized.
-r dir
Load serialized schemas from directory dir if found there, otherwise load schemas from their XML sources.
-w dir
Serialize loaded schemas to directory dir.
-gendoc dir
Generate documentation in directory dir.

See note about the generated documentation.

-css URL
Add link to specified CSS URL in generated documentation.
-v
Be verbose. Default: be quiet.

It is possible to specify several -s and -ss options. Such multiple schemas (and their included/imported schemas, if any) are merged into one big global schema.

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 the following places:

Limitations:

Examples:

3.1 About the generated documentationContents

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

This manual is intended to help content authors create instances conforming to a given XML schema or DTD. This manual is not intended to help XML schema or DTD authors document their design.

Note that, for now, the documentation generator cannot extract documentation contained in a schema (i.e. in annotation/documentation elements) and merge extracted documentation with automatically generated documentation.

4 Dtdvalid command referenceContents

dtdvalid ?options? ?xml_doc ... xml_doc?

Checks a DTD for validity. Checks an XML document for validity against a DTD.

Options:

-o file
Generate report in file file. Default: output report to console.
-d dtd
Use DTD dtd to validate XML documents. Default: use DTD specified in the XML document.
-dd pubid dtd
Same as -d except that first parameter specifies the public ID of the DTD. This public ID is mandatory if the DTD is to be serialized or deserialized.
-r dir
Load serialized DTDs from directory dir if found there, otherwise load DTDs from their XML sources.
-w dir
Serialize loaded DTDs to directory dir.
-gendoc dir
Generate documentation in directory dir.

See note about the generated documentation.

-css URL
Add link to specified CSS URL in generated documentation.
-v
Be verbose. Default: be quiet.

When the -d or -dd command-line options are used, the constraint that the root element of an XML instance and the document element of the DTD must match is not checked.

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 (';').

Notes:

Examples:

5 Dtdtoxsd command referenceContents

dtdtoxsd ?options? in_dtd_file out_xsd_file

Converts DTD in_dtd_file to XML-Schema out_xsd_file.

Options:

-t namespace
Use namespace as the target namespace of the generated XML-Schema. Default: none (generated schema has no target namespace).

If the DTD declares text, external or unparsed entities, these declarations are copied to a file which has the same basename as out_xsd_file but with extension .ent. This file is created in the same directory as out_xsd_file.

In addition to out_xsd_file, a schema file named xml.xsd is created in the same directory as out_xsd_file. This secondary schema declares standard attributes xml:space, xml:lang and xml:base. The main schema always imports xml.xsd even if it doesn't reference any of the standard attributes.

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 (';').

Limitations:

Examples:

6 Implementation limitsContents

6.1 Limitations related to XML Schema DatatypesContents

Formal reference: XML Schema Part 2: Datatypes.

6.2 Limitations related to XML Schema StructuresContents

Formal reference: XML Schema Part 1: Structures.

Constraints on XML instances which are not checked:

Constraints on XML schemas which are not checked:

Other specificities:

6.3 Limitations related to DTD supportContents

Formal reference: Extensible Markup Language (XML) 1.0 (Second Edition).

Constraints on XML instances which are not checked:

Constraints on DTDs which are not checked:

7 Enhancements and bug fixesContents

7.1 V3.0 Patch 1 (December 2, 2005)Contents

Bug fixes:

7.2 V2.11 (July 11, 2005)Contents

Bug fixes:

7.3 V2.10 (June 2, 2005)Contents

Bug fixes:

7.4 V2.9 Patch 1 (April 4, 2005)Contents

Bug fixes:

7.5 V2.9 (February 7, 2005)Contents

Bug fixes:

Regressions:

7.6 V2.6 Patch 1 (June 18, 2004)Contents

Enhancements:

Bug fixes:

7.7 V2.6 (May 10, 2004)Contents

Enhancements:

Bug fixes:

7.8 V2.5 Patch 3 (March 10, 2004)Contents

Bug fixes:

7.9 V2.5 Patch 1 (December 15, 2003)Contents

Bug fixes:

7.10 V2.5 (November 04, 2003)Contents

Option -gendoc added to xsdvalid and dtdvalid allows to automatically generate an hypertext (HTML) reference manual from an XML schema or a DTD. See note about the generated documentation.

7.11 V2.4 (August 13, 2003)Contents

Enhancements:

Bug fixes:

7.12 V2.0 Beta 1 (September 3, 2002)Contents

Changed version number to V2 to use the same version number as XXE.

7.13 V1.0 Patch 3 (August 19, 2002)Contents

Forgot to update the documentation for the release of Patch2.

7.14 V1.0 Patch 2 (July 29, 2002)Contents

Validating really large XML schemas on Windows was not possible due to a stack overflow error. Increasing the stack size by editing xsdvalid.bat and adding -Xss1m to the Java command line had no effect.

Xsdvalid 1.0 Patch2 requires Java 1.4. It will not run with Java 1.3. Do not upgrade if you cannot install Java 1.4 on your machine.

7.15 V1.0 Patch 1 (April 25, 2002)Contents

Fixed an obscure bug related to restrictions of the NMTOKENS, IDREFS, and ENTITIES simple types.

7.16 V1.0 (January 9, 2002)Contents

Initial release.