www.altova.com
Previous  Top  Next

XSLT 2.0 Transformations


Syntax

The syntax to invoke XSLT 2.0 transformations is:

 

AltovaXML -xslt2 xsltfile -in xmlfile [-out outputfile] [options]

 

where

 

AltovaXML

Calls the application.

-xslt2

Specifies that the Altova XSLT 2.0 Engine is to be used for an XSLT transformation; the engine uses the XSLT 2.0 file xsltfile for the transformation.

-in

Specifies the XML file xmlfile to be transformed and its location.

-out

Specifies the output file outputfile and its location. If this option is omitted, the output is written to standard output.

 

The following options are available:

 

-param

Takes the instruction paramname=XPath expression. The -param switch is used before each global parameter. Double quotes must be used if a space is included in an XPath expression—whether in a path expression itself or in a string literal in the expression. See examples.

-xslstack

The stack size is the maximum depth of executed instructions, and can be changed with the -xslstack value. The minimum allowed value is 100. The default stack size is 1000. If the stack size is exceeded during a transformation, an error is reported.

-namedTemplate
(or -n)

Sets the initial named template. A space separates the argument from its value. Example: -namedTemplate MyTemplate

-mode (or -m)

Sets the initial template mode. A space separates the argument from its value. Example: -mode MyMode

 

Note:

 

The XSLT file must be specified in the command line instruction; an XSLT file referenced in an <?xml-stylesheet?> processing instruction in the XML document is not automatically used.
If the -out parameter is omitted, output is written to the standard output.
The XSLT 2.0 Engine can be used in its backward compatibility mode to process an XSLT 1.0 stylesheet. The output, however, could be different than that produced by the XSLT 1.0 Engine processing the same XSLT 1.0 stylesheet.

 

 

Examples

 

AltovaXML -xslt2 test.xslt -in test.xml -out testout.xml
AltovaXML -xslt2 test.xslt -in test.xml -out testout.xml

-param date=//node/@att1

AltovaXML -xslt2 test.xslt -in test.xml -out testout.xml

-param date="//node/@att1 | //node/@att2"

AltovaXML -xslt2 test.xslt -in test.xml -out testout.xml

-param date=node/@att1 -param title='stringwithoutspace'

AltovaXML -xslt2 test.xslt -in test.xml -out testout.xml

-param date=node/@att1 -param title="'string with spaces'"

 


Previous  Top  Next

© 2008 Altova