www.altova.com
Previous  Top  Next

XML Validation and Well-Formedness


Syntax

The syntax to invoke XML validation is:

 

AltovaXML -validate xmlfile [-schema schemafile | -dtd dtdfile]

 

where

 

AltovaXML

Calls the application

-validate (or -v)

Specifies that the Altova XML Validator is to be used to validate the file xmlfile.

 

The following options are available:

 

-schema (or -s)

Specifies the XML Schema file schemafile to be used for validation.

-dtd (or -d)

Specifies the DTD file dtdfile to be used for validation.

 

Note:

 

When no XML Schema or DTD file is specified as a command line option, an XML Schema or DTD file must be specified in the XML document itself.
If an XML Schema or DTD file is specified as a command line option and an XML Schema or DTD file is referenced in the XML file, then the file specified in the command line option is used for validation.

 

 

The syntax to invoke the well-formedness check is:

 

AltovaXML -wellformed xmlfile

 

where

 

AltovaXML

Calls the application

-wellformed (or -w)

Specifies that the Altova XML Validator is to be used to check the well-formedness of the file xmlfile.

 

 

Examples

 

AltovaXML -validate test.xml -schema testschema.xml
AltovaXML -v test.xml -dtd testdtd.dtd
AltovaXML -wellformed test.xml
AltovaXML -w test.xml

 

Note:For using Altova XML in batch commands, it is important to know the following:

 

The return code of the last executed command is stored in the errorlevel variable, the value of which can be retrieved with a batch command such as ECHO %errorlevel%.
The return codes are 0 = well-formed/valid; 1 = not well-formed/invalid.

 


Previous  Top  Next

© 2008 Altova