Xslt Command Line Reference

Xslt.exe is the XmlPrime command line XSLT processor. It executes a specified transformation, with the specified options.

The command-line options are case sensitive.

 
Xslt.exe [Options] [XsltFile] [Parameters]
 

Arguments

ArgumentDescription

XsltFile

The path to the transformation.

Options

OptionAliasDescription

--basic

Disables schema-aware processing.

By default, schema-aware processing is not enabled, and input documents are assumed to by untyped.

--benchmark n

-b n

Enables benchmarking mode

--collection uri

Specifies the default collection URI uri, which must be a valid URI.

-dt

Initiate execution of the transform with the template named initial-template in the XSLT namespace.

--dtd

-d

Enables the use of DTDs to validate input documents. By default, documents are not validated against their DTDs. Note that the DTDs are retrieved even when this option is disabled, as they are used to resolve entity references.

--emacs

Output errors and warnings in a single line format.

--explain

-e

Displays the transformation execution plan. This is a representation of the transformation after it has been compiled and fully optimized. This explains how XmlPrime intends to perform the transformation, and can be useful in highlighting errors in transforms if they are producing unexpected results. The execution plan is output to the standard error stream.

--help

-?

Displays usage instructions for the command line tool.

-il

Specifies that the processor should compile the transform to CIL byte code. This is only supported in the commercially licensed product.

-im

Initiate execution of the transformation with the specified template mode. A namespace can be referred to with the syntax {namespace}localname.

-it

Initiate execution of the transform with the specified named template. A namespace can be referred to with the syntax {namespace}localname.

--multiple

-m

Allows multiple compilation errors to be reported. By default, compilation is aborted after the first error is discovered.

--noxsiloc

Prevents schemas referenced by xsi:schemaLocation or xsi:noNamespaceSchemaLocation in imported documents from being loaded and added to the set of schemas used for validation.

-o filename

Specifies a file to which the primary output of the transformation should be written. If the file already exists it is overwritten, otherwise a new file is created. If this option is omitted then the primary output of the transformation is sent to the standard output.

-O0

Disables compiler optimizations. This cannot be used in conjunction with any other -O option.

-O1

Disables any compiler optimizations that significantly change the structure of the transformation. This is useful for producing an execution plan if the result of a transformation is not what you expect. This cannot be used in conjunction with any other -O option.

-O2

Disables join optimizations. This feature is mainly for testing purposes. This cannot be used in conjunction with any other -O option.

-O3

Enabled join optimizations. This is the default optimization level. This cannot be used in conjunction with any other -O option.

-O4

Enables function specialization. This may significantly increase the compilation time. This cannot be used in conjunction with any other -O option.

--plan filename

-p filename

Write the execution plan as XML to the named file

--profile filename

Writes execution profiling information to the specified file.

--preserve

Preserves all white space text nodes in all input documents. This cannot be used in conjunction with the

--strip
option.

-s document

Sets the context document for the transformation. document can either be a path to, or the URI of, an XML document to use as the context item.

--schema

-v

Validates input documents with XML Schema against the available schemas. All documents passed in on the command line or read by the query are validated against the available schemas. The available schemas used for validation contain:

  • Schemas imported using the --xsd option.
  • Schemas imported in the query.
  • Unless the --noxsiloc option is set, any schemas referenced in xs:schemaLocation or xs:noNamespaceSchemaLocation attributes are used to validate the document.

Note that this does not affect validate expressions, which will only validate against schemas imported in the query.

--schema-aware

-sa

Enables schema-aware processing.

By default, schema-aware processing is not enabled, and input documents are assumed to by untyped.

--strip

Strips insignificant whitespace text nodes from all input documents. This cannot be used in conjunction with the --preserve option.

--time

-t

Displays the time taken to analyse and evaluate the transformation. Timing information is sent to the standard error stream. To get more accurate timings, this can be used in combination with the --repeats and --noserialize flags.

--timezone z

Sets the implicit timezone. The timezone value z is specified in the form (('+' | '-') hh ':' mm) or the value 'Z', e.g. +01:00.

--trace

This option causes a message to be output to the console every time a document is accessed by the transformation, and enables output from the trace function in the transformation to be displayed. Trace information is sent to the standard error stream.

--version

This option causes version information to be output to the console.

--xml10

Use XML 1.0 (5th edition) and Namespaces in XML 1.0. Note that in the current version, only XML 1.0 4th edition documents can be used as inputs.

--xml11

Use XML 1.1 (2nd edition) and Namespaces in XML 1.1. Note that in the current version, only XML 1.0 4th editino documents can be used as inputs.

--xsd schema

-x schema

Specifies the filename of an XML Schema to be added to the set of schemas available for validation. This mechanism also specifies the location of schemas imported in the transformation with no location hints. If the transformation imports a schema with the same namespace, then the schema supplied on the command line is used, regardless of which location hints are used.

--xt20

Selects an XSLT 2.0 processor (default).

--xt30

Selects an XSLT 3.0 processor (implementation incomplete).

Parameters

ParameterDescription

parametername=expression

Sets a stylesheet parameter to the specified value.

A stylesheet parameter is the definition of a global variable declared using xsl:param as a child of the xsl:stylesheet or xsl:transform element in the transformation.

The parametername is the local name of the parameter to be set. The parameter is assumed to have no namespace. An external variable declared with a namespace can be referred to with the syntax {namespace}localname. If no external variable is found with the specified name, then this parameter is ignored.

expression is an XPath expression which is evaluated to give the value of the parameter.

Note that when passing string-valued parameters using Command Prompt or Powershell, extra quoting is required, for example "param='cheese'".

+parametername=document

Sets a stylesheet parameter to the specified document.

A stylesheet parameter is the definition of a global variable declared using xsl:param as a child of the xsl:stylesheet or xsl:transform element in the transformation.

The parametername is the local name of the parameter to be set. The parameter is assumed to have no namespace. An external variable declared with a namespace can be referred to with the syntax {namespace}localname. If no external variable is found with the specified name, then this parameter is ignored.

document is a path or URI to an XML document.

!parameter=value=value

Sets a serialization parameter.

Serialization parameters define how the result of the query is serialized. This is equivalent to adding the following declarations to the query:

 
              
declare namespace serialization="http://www.xmlprime.com/serialization";
declare option serialization:parameter "value";
            
 

If the requested serialization parameter does not exist this parameter is ignored. If a parameter is also set in the query, then the value passed on the command line takes precedence.

For a detailed description of all the available serialization parameters, see Serialization parameters.