valxsd (xsd)

www.altova.com Expand/Collapse All Print this Topic Previous Page Up One Level Next page

Home >  Command Line Interface (CLI) > XML, DTD, XSD Validation Commands >

valxsd (xsd)

The valxsd | xsd command validates one or more XML Schema documents (XSD documents) according to the W3C XML Schema Definition Language (XSD) 1.0 or 1.1 specification. Note that it is the schema itself that is validated against the XML Schema specification, not an XML instance document against an XML Schema.

 

Windows

RaptorXML valxsd | xsd [options] InputFile

Linux

raptorxml valxsd | xsd [options] InputFile

Mac

raptorxml valxsd | xsd [options] InputFile

 

 

The InputFile argument is the XML Schema document to validate. The --xsd-version=1.0|1.1|detect option specifies the XSD version to validate against, with the default being 1.0.

 

To validate multiple documents, either: (i) list the files to be validated on the CLI, with each file separated from the next by a space; or (ii) list the files to be validated in a text file (.txt file), with one filename per line, and supply this text file as the InputFile argument together with the --listfile option set to true (see the Options list below).

 

Examples

 

raptorxml valxsd c:\Test.xsd
raptorxml xsd --verbose=true c:\Test.xsd
raptorxml xsd --listfile=true c:\FileList.txt

 

Click to expand/collapseCasing and slashes on the command line

RaptorXML on Windows

raptorxml on Unix (Linux, Mac)

 

* Note that lowercase (raptorxml) works on all platforms (Windows, Linux, and Mac), while upper-lower (RaptorXML) works only on Windows and Mac.

* Use forward slashes on Linux and Mac, backslashes on Windows.

 

Options

The command's options are listed below, organized into groups. Values can be specified without quotes except in two cases: (i) when the value string contains spaces, or (ii) when explicitly stated in the description of the option that quotes are required.

 

Click to expand/collapseValidation and processing

--ct-restrict-mode = 1.0|1.1|default

Specifies how to check complex type restrictions. A value of 1.0 checks complex type restrictions as defined in the XSD 1.0 specification—even in XSD 1.1 validation mode. A value of 1.1 checks complex type restrictions as defined in the XSD 1.1 specification—even in XSD 1.0 validation mode. A value of default checks complex type restrictions as defined in the XSD specification of the current validation mode (1.0 or 1.1). The default value is default.

 

--listfile = true|false

If true, treats the command's InputFile argument as a text file containing one filename per line. Default value is false. (An alternative is to list the files on the CLI with a space as separator. Note, however, that CLIs have a maximum-character limitation.) Note that the --listfile option applies only to arguments, and not to options.

Note:   Boolean option values are set to true if the option is specified without a value.

 

--recurse = true|false

Used to select files within sub-directories, including in ZIP archives. If true, the command's InputFile argument will select the specified file also in subdirectories. For example: test.zip|zip\test.xml will select files named test.xml at all folder levels of the zip folder. The wildcard characters * and ? may be used. So, *.xml will select all .xml files in the (zip) folder. The option's default value is false.

Note:   Boolean option values are set to true if the option is specified without a value.

 

--schema-imports = load-by-schemalocation | load-preferring-schemalocation | load-by-namespace | load-combining-both | license-namespace-only

Specifies the behaviour of xs:import elements, each of which has an optional namespace attribute and an optional schemaLocation attribute: <import namespace="someNS" schemaLocation="someURL">. The option specifies whether to load a schema document or just license a namespace, and, if a schema document is to be loaded, which information should be used to find it. Default: load-preferring-schemalocation.

The behavior is as follows:

 

load-by-schemalocation: The value of the schemaLocation attribute is used to locate the schema, taking account of catalog mappings. If the namespace attribute is present, the namespace is imported (licensed).
load-preferring-schemalocation: If the schemaLocation attribute is present, it is used, taking account of catalog mappings. If no schemaLocation attribute is present, then the value of the namespace attribute is used via a catalog mapping. This is the default value.
load-by-namespace: The value of the namespace attribute is used to locate the schema via a catalog mapping.
load-combining-both: If either the namespace or schemaLocation attribute has a catalog mapping, then the mapping is used. If both have catalog mappings, then the value of the --schema-mapping option (XML/XSD option) decides which mapping is used. If no catalog mapping is present, the schemaLocation attribute is used.
license-namespace-only: The namespace is imported. No schema document is imported.

 

--schemalocation-hints = load-by-schemalocation | load-by-namespace | load-combining-both | ignore

Specifies the behavior of the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes: Whether to load a schema document, and, if yes, which information should be used to find it. Default: load-by-schemalocation.

 

The load-by-schemalocation value uses the URL of the schema location in the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes in XML instance documents. This is the default value.
The load-by-namespace value takes the namespace part of xsi:schemaLocation and an empty string in the case of xsi:noNamespaceSchemaLocation and locates the schema via a catalog mapping.
If load-combining-both is used and if either the namespace part or the URL part has a catalog mapping, then the catalog mapping is used. If both have catalog mappings, then the value of the --schema-mapping option (XML/XSD option) decides which mapping is used. If neither the namespace nor URL has a catalog mapping, the URL is used.
If the option's value is ignore, then the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes are both ignored.

 

--schema-mapping = prefer-schemalocation | prefer-namespace

If  schema location and  namespace are both used to find a  schema document, specifies which  of them should  be preferred during catalog lookup. (If either the --schemalocation-hints or the --schema-imports option has a value of load-combining-both, and if the namespace and URL parts involved both have catalog mappings, then the value of this option specifies which of the two mappings to use (namespace mapping or URL mapping; the prefer-schemalocation value refers to the URL mapping).) Default is prefer-schemalocation.

 

--script = FILE

Executes the Python script in the submitted file after validation has been completed. Add the option multiple times to specify more than one script.

 

--api, --script-api-version = 1|2|2.1|2.2|2.3|2.4|2.4.1|2.5|2.6|2.7

Specifies the Python API version to be used for the script. The default value is the latest version, currently 2.7. Instead of the values 1 and 2, you can also use the values 1.0 and 2.0, respectively.

 

--script-output = FILE

Writes the script's standard output to the file named in FILE.

 

--script-param = KEY:VALUE

Additional user-specified parameters that can be accessed during the execution of Python scripts. Add the option multiple times to specify more than one script parameter.

 

--xinclude = true|false

Enables XML Inclusions (XInclude) support. Default value is false. When false, XInclude's include elements are ignored.

Note:   Boolean option values are set to true if the option is specified without a value.

 

--xml-mode = wf|id|valid

Specifies the XML processing mode to use for the XML instance document: wf=wellformed check; id=wellformed with ID/IDREF checks; valid=validation. Default value is wf. Note that a value of valid requires that each instance document loaded during processing references a DTD. If no DTD exists, an error is reported.

 

--xml-mode-for-schemas = wf|id|valid

Specifies the XML processing mode to use for XML schema documents: wf=wellformed check; id=wellformed with ID/IDREF checks; valid=validation. Default value is wf. Note that a value of valid requires that each schema document loaded during processing references a DTD. If no DTD exists, an error is reported.

 

--xsd-version = 1.0|1.1|detect

Specifies the W3C Schema Definition Language (XSD) version to use. Default is 1.0. This option can also be useful to find out in what ways a schema which is 1.0-compatible is not 1.1-compatible. The detect option is an Altova-specific feature. It enables the version of the XML Schema document (1.0 or 1.1) to be detected by reading the value of the vc:minVersion attribute of the document's <xs:schema> element. If the value of the @vc:minVersion attribute is 1.1, the schema is detected as being version 1.1. For any other value, or if the @vc:minVersion attribute is absent, the schema is detected as being version 1.0.

 

 

Click to expand/collapseCatalogs and global resources

--catalog = FILE

Specifies the absolute path to a root catalog file that is not the installed root catalog file. The default value is the absolute path to the installed root catalog file (<installation-folder>\Altova\RaptorXMLServer2019\etc\RootCatalog.xml). See the section, XML Catalogs, for information about working with catalogs.

 

--user-catalog = FILE

Specifies the absolute path to an XML catalog to be used in addition to the root catalog. See the section, XML Catalogs, for information about working with catalogs.

 

--enable-globalresources = true|false

Enables global resources. Default value is false.

Note:   Boolean option values are set to true if the option is specified without a value.

 

--gc | --globalresourceconfig = VALUE

Specifies the active configuration of the global resource (and enables global resources).

 

--gr | --globalresourcefile = FILE

Specifies the global resource file (and enables global resources).

 

 

Click to expand/collapseMessages, errors, help, timeout, version

--error-format = text|shortxml|longxml

Specifies the format of the error output. Default value is text. The other options generate XML formats, with longxml generating more detail.

 

--error-limit = N | unlimited

Specifies the error limit with a value range of 1 to 9999 or unlimited. The default value is 100. Processing stops when the error limit is reached. Useful for limiting processor use during validation/transformation.

 

--help

Displays help text for the command. For example, valany --h. (Alternatively the help command can be used with an argument. For example: help valany.)

 

--log-output = FILE

Writes the log output to the specified file URL. Ensure that the CLI has write permission to the output location.

 

--network-timeout = VALUE

Specifies the timeout in seconds for remote I/O operations. Default is: 40.

 

--verbose = true|false

A value of true enables output of additional information during validation. Default value is false.

Note:   Boolean option values are set to true if the option is specified without a value.

 

--verbose-output = FILE

Writes verbose output to FILE.

 

--version

Displays the version of RaptorXML Server. If used with a command, place --version before the command.

 

--warning-limit = N | unlimited

Specifies the warning limit in the range 1-65535 or unlimited. Processing continues if this limit is reached, but further warnings are not reported. The default value is 100.

 

 

 


© 2019 Altova GmbH