Contents

1 Introduction
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 distrib/ directory
3 Xsdvalid command reference
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 V2.0 Beta1 (September 3, 2002)
7.2 V1.0 Patch3 (August 19, 2002)
7.3 V1.0 Patch2 (July 29, 2002)
7.4 V1.0 Patch1 (April 25, 2002)
7.5 V1.0 (January 9, 2002)

1 IntroductionContents

This distribution contains the 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 xsdvalid

2.1.1 Requirements

Xsdvalid and dtdvalid have been tested with:

2.1.2 Install on Unix

Procedure:

  1. Unpack the xsdvalid distribution somewhere.
    $ cd 
    $ gzip -d -c xsdvalid-20p2.tgz | tar xvf -
    $ ls xsdvalid-1
    docs/
    xp.jar
    resolver.jar
    xsdvalid.jar
    xsdvalid
    xsdvalid.bat
    dtdvalid
    dtdvalid.bat
    dtdtoxsd
    dtdtoxsd.bat
    ...
  2. Copy the xsdvalid, dtdvalid and dtdtoxsd shell scripts and *.jar to a directory referenced in your path (example /usr/local/bin).
    $ su
    $ cp ~/xsdvalid-20p2/xsdvalid /usr/local/bin
    $ cp ~/xsdvalid-20p2/dtdvalid /usr/local/bin
    $ cp ~/xsdvalid-20p2/dtdtoxsd /usr/local/bin
    $ cp ~/xsdvalid-20p2/*.jar /usr/local/bin
    $ chmod a+rx /usr/local/bin/xsdvalid
    $ chmod a+rx /usr/local/bin/dtdvalid
    $ chmod a+rx /usr/local/bin/dtdtoxsd
    $ chmod a+r /usr/local/bin/*.jar

2.1.3 Install on Windows

Install on Windows is similar to the install on Unix but under Windows you'll have to copy xsdvalid.bat, dtdvalid.bat and dtdtoxsd.bat rather than the xsdvalid, dtdvalid and dtdtoxsd shell scripts.

2.2 Content of the distrib/ directory

docs/xsdvalid
Contains this user guide.
docs/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.
docs/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.
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.)
*.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 ('-' means none) 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.
-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.

Limitations:

Examples:

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.
-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.

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.

Limitations:

Examples:

6 Implementation limitsContents

6.1 Limitations related to XML Schema Datatypes

Formal reference: XML Schema Part 2: Datatypes.

6.2 Limitations related to XML Schema Structures

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 support

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 V2.0 Beta1 (September 3, 2002)

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

7.2 V1.0 Patch3 (August 19, 2002)

Forgot to update the documentation for the release of Patch2.

7.3 V1.0 Patch2 (July 29, 2002)

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.4 V1.0 Patch1 (April 25, 2002)

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

7.5 V1.0 (January 9, 2002)

Initial release.