SchemaQualityChecker via Commandline

To invoke the SchemaQualityChecker use the following syntax:
  SchemaQualityChecker [–options] file1 file2 file3 ... fileN

As a convenience, it is also permissible to use SQC:
  SQC [–options] file1 file2 file3 ... fileN

where:

file1 file2 file3 ... fileN — are either files to check for validity or directories containing such files. Wildcards can also be used, such as po*.xsd for all filenames in the current directory that begin with po and have file extension of .xsd. Note: Currently, SchemaQualityChecker does not recognize filenames containing blank spaces. Filenames with blank spaces will be interpreted as two (or more) different files.

[–options] Meaning
–r

When this option is specified, if file1 is a directory, all its subdirectories will be processed recursively. By default (when this option is omitted), if file1 is a directory only files with ".xsd" extension located in that directory will be converted; other files and subdirectories will be ignored.

–cost maxCost

maxCost is the maximum cost of an allowed check operation. By default the maximum cost is 10 which allows all validity checks to be performed. You can increase the speed of the program by allowing only check operations with a small cost (you do so by reducing the maxCost value):

Checks Performed Cost
Non-ambiguous content model 10
Element declarations consistent 9
A KeyRef is consistent with the type of the element declaration where it appears 6
A Key or an Unique is consistent with the type of the element declaration where it appears 5
Redefinition of a Model Group Definition 5
Content type of a complex type is compatible with its basetype content type 5
An element declaration has only one attribute whose type is derived from ID 5
Type derivation (including circular definition check) 4
Circular definition in an Attribute Group Definition 4
Circular definition in a Model Group Definition 4
Duplicated definitions 4
A given string is in the value space of a given type 3
Validity of XPath expressions 3
Redefinition of an Attribute Group Definition 3
The value of an enumeration pattern facet of a type derived from NOTATION matches a Notation declaration 3
Reference resolution 3
Equivalence class ok 3
Attributes defined by a complex type are compatible with the ones defined by its basetype 3
The attribute wildcard defined by a complex type is compatible with the one defined by its basetype 3
Various inexpensive checks 2
Various inexpensive checks 1
–reportAsXML filename

filename is the file where the error report will be saved as a XML document. If this option is not selected, all the error messages will be written on the standard output.

If there is only a single file to check, and the first character of the argument after –reportAsXML is the period ".", then SQC will behave as if the reportAsXML filename value was the specified input file followed by whatever characters were specified as the reportAsXML filename.

Note: an XSL stylesheet for rendering this file is distributed in the directory samples and is called ErrorReport.xsl. This stylesheet has been tested using Microsoft Internet Explorer 5.5 with the MSXML3 Parser update. (See http://msdn.microsoft.com/downloads/ for details.) It has also been tested with Xalan Java Version 1.2D02.

–styleSheet uri uri is the uri of the stylesheet for the error report which will be used in the xml-stylesheet processing instruction used in the reportAsXML document. If this option is not selected, the value used will be SchemaQualityCheckerDir/ErrorReport.xsl.
–errorReportDtd dtdURL The reportAsXML document will include a DOCTYPE statement. 

Note: The latest version of the Dtd for SQC output is located at SchemaQualityCheckerDir/XMLSchemaQualityCheckerErrorReport.dtd.

–errorReportSchema schemaURL fill

Indicate that SQC should set the 'xsi:noNamespaceSchemaLocation' attribute of the root element of the output document to the URL location of the schema for SQC output.

Note: The latest version of the Schema for SQC output is located at SchemaQualityCheckerDir/XMLSchemaQualityCheckerErrorReport.xsd.

–haltAtFirstError Stops validation of the schema when the first error or warning situation is encountered.
–requireEachDocumentValid

When this option is set, SQC will check that schemas directly or indirectly imported, included or redefined by the main schema are valid by themselves. In other words, if this option is set, errors will be reported to indicate that if included or imported schemas were accessed directly, they would not be valid.

–entireSchemaValid

When this option is set, SQC will not check that schemas directly or indirectly imported, included or redefined by the main schema are valid by themselves. This is the default.

–emb

When this option is set, SQC will not complain if the root element of the input document is not <xs:schema>, where "xs" prefix is bounded to "http://www.w3.org/2001/XMLSchema". It will also check for the validity of schemas embedded in the input document. When this option is used, the option '–schemaLocation' or '–noNSSchemaLocation' must be specified to provide the location of the schema to which the root element conforms.

–wsdl

When this option is set, SQC will be able to process input documents whose root element is <xs:schema> or <wsdl:definitions>, where "xs" and "wsdl" prefixes are respectively bounded to "http://www.w3.org/2001/XMLSchema" and to "http://schemas.xmlsoap.org/wsdl/".

Note: For performance reasons, SQC uses a cached and slightly modified version of the schema for WSDL available at http://schemas.xmlsoap.org/wsdl. If a future version of WSDL specification changes the namespace and/or the schema for WSDL, please use the option "–schemaLocation newWSDLNamespace newWSDLSchemaLocation" to make SQC aware of the change.

–xform

When this option is set, SQC will be able to process input documents whose root element is <xs:schema> or <xforms:model>, where "xs" and "xforms" prefixes are respectively bounded to "http://www.w3.org/2001/XMLSchema" and to "http://www.w3.org/2002/01/xforms".

Note: Since as of February 4, 2002 XForms specification was still at the stage of "working draft", the namespace of XForms or/and the schema for XForms may change before a new version of SQC is available. If it is the case, please use option '–schemaLocation newXFormsNamespace newXFormsSchemaLocation' to make SQC aware of the change.

–schemaLocation namespace locationURL

This option indicates the location of the schema definition to use to validate an element whose namespace is "namespace". locationURL must be a valid absolute URL. This option is particularly important when option '–emb' is specified.

–noNSSchemaLocation locationURL

This option indicates the location of the schema definition to use to validate unqualified elements. locationURL must be a valid absolute URL. This option is particularly important when option '–emb' is specified.

–fullProcessingDescAxis

This option indicates that SQC should detect warnings due to possible inconsistencies in identity constraints which have at least one field xpath containing a descendant axis ('.//'). If this option is not set, SQC will not issue the following warnings for previously described identity constraints :

  • a field evaluates to an element whose type is a complex type.
  • a field evaluates to a node set containing nodes that may appear at the same time.

–reportLocWithoutPath

print locations of errors in the message section of an error without full path information, but only the last part of the file or web name of the document containing the error.

 –help Outputs on stdout a reminder of the options. –? does the same thing. 

[–options]
(only for debugging SQC)
Meaning
 –debugInfo

When this option is set, messages useful for debugging of the Quality Checker will be displayed on the standard output.

 –debugMemory

When this option is set, information about SQC's memory usage will be displayed on the standard output.

 –indicateProgress Outputs on stdout indicators of what line of the Schema the parser is currently processing
 –outputExceptionName

When this option is set, SQC will include, in the XML error report file, names of exceptions corresponding to errors reported.

Note: if option '–reportAsXML error.xml' is not specified, this option has no effect.

 –locationCorrespondence file fill This option allows SQC to redirect a file from one remote location to another. file is the location correspondence file that contains the mapping between the location specified in a schema and the location used during validation. (For more information about this option, please contact us at xschema@us.ibm.com).