STILTS-XSDVALIDATE(1)

NAME
stilts-xsdvalidate - Validates against XML Schema

SYNOPSIS

stilts xsdvalidate [doc=<location>] [schemaloc=<namespace>=<location> ...] [topel=[{<ns-uri>}][<local-name>]] [verbose=true|false] [uselocals=true|false] [nsurl=true|false]

DESCRIPTION

xsdvalidate is a utility for validating XML documents against XML Schemas. This is not very specific to STILTS, and does not claim to do a better job than other XSD validators out there, so if you can find another one that suits your purposes, please use it. It was added to the package however since it seems hard to find suitable tools that do this job.

The schema is not specified by runtime parameters, elements in a given XML document are validated against any schemas associated with the namespaces defined in that document. However, it is possible to override the locations of schemas using runtime parameters. By using the schemaloc parameter, you can tell the validator to validate against a local copy of a schema or one at a given URL, rather than the copy that is referenced by xsi:schemaLocation attributes in the document itself. That can be convenient when developing a schema with a public namespace that is fixed, but content which is still subject to change. Moreover, some local copies of W3C and IVOA schemas are kept within the application, so that external network accesses are not required during validation.

By default, successful validation results in no output and a success exit status, but if there are validation errors then some indication of what went wrong is printed to standard output and the command exits with an error. This makes it suitable for use in makefiles.

OPTIONS

doc=<location>
    Location of XML document to validate.

schemaloc=<namespace>=<location> ...
    Assignments of override schema locations to XML namespaces. One or more assignments may be supplied, each of the form <namespace>=<location> where the location may be a filename or URL. Multiple assignments may be made by supplying the parameter multiple times, or using a space character as a separator.

    Each assignment causes any reference to the given namespace in the validated document to be validated with reference to the XSD schema at the given location rather than to a schema acquired in the default way (using xsi:schemaLocation attributes or using the namespace as a retrieval URL).

topel=[{<ns-uri>}][<local-name>]
    Local name of the top-level element expected in the parsed document. If the actual parsed top-level element has a local name differing from this, an error will be reported. If no value is specified (the default) no checking is done.

verbose=true|false
    If true, some INFO reports will be displayed alongside any ERROR reports resulting from the parse. This may be useful for diagnosis or reassurance.

uselocals=true|false
    Whether to use local copies of VO schemas where available. If true, copies of some IVOA schemas stored within the application are used instead of retrieving them from their http://www.ivoa.net/ URLs. Setting this true is generally faster and more robust against network issues, though it may risk retrieving out of date copies of the schemas.

nsurl=true|false
    Whether to use the namespace URI itself as a dereferencable URL to download a schema if no location has been supplied from elsewhere. For a namespace http://example.com/ns1 this is like assuming the presence of a xsi:schemaLocation="http://example.com/ns1 http://example.com/ns1" entry. Of course the XSD must be available at the location given by the namespace URI for this to work.

    Setting this true usually does the right thing, but it may risk hitting schema-hosting web servers too hard, and maybe it's too lenient on XML documents that don't have the right xsi:schemaLocation attributes; but XMLSchema-1 Sec 4.3.2 says it's up to the processor (i.e. this command) to figure out where to get schemas from.

SEE ALSO
stilts(1)

If the package stilts-doc is installed, the full documentation SUN/256 is available in HTML format:
file:///usr/share/doc/stilts/sun256/index.html

VERSION
STILTS version 3.5.4-debian

This is the Debian version of Stilts, which lack the support of some file formats and network protocols. For differences see
file:///usr/share/doc/stilts/README.Debian

AUTHOR
Mark Taylor (Bristol University)