To perform a transformation, you can call Xalan-C++ from the command line (or script),
or from within an application (see Usage Patterns).
TestXSLT provides a command-line interface
for performing XSL transformation. To perform a transformation from the command line or a script,
do the following:
- Download Xalan-C++.
- Set the path to include the build directory.
- Call the TestXSLT executable with the appropriate flags and
arguments (described below). The following command line, for example, includes the -IN, -XSL,
and -OUT flags with their accompanying arguments -- the XML source document, the XSL
stylesheet, and the output file:
TestXSLT -IN foo.xml -XSL foo.xsl -OUT foo.out
The command line utility can take the following flags and arguments (the flags are case insensitive):
| | |
| -IN inputXMLURL
-XSL XSLTransformationURL
-OUT outputFileName
-ESCAPE chars(Which characters to escape -- default is <>&"'\r\n)
-V (Version info)
-QC (Quiet Pattern Conflicts Warnings)
-Q (Quiet Mode)
-INDENT (Number of spaces to indent each level in output tree --default is 0)
-TT (Trace the templates as they are being called)
-TG (Trace each result tree generation event)
-TS (Trace each selection event)
-TTC (Trace the template children as they are being processed)
-XML (Use XML formatter and add XML header)
-TEXT (Use simple Text formatter)
-HTML (Use HTML formatter)
-NH (Don't write XML header. Only works with -HTML flag set.)
-PARAM name expression (Set a stylesheet parameter) | |
| | |
Use -IN to specify the XML source document.
Use -XSL to specify the XSL stylesheet file.
Use -TEXT if you want the output to include only text nodes without any escaping.
Use -HTML to write 4.0 transitional HTML (some elements, such as <br>, are
not well formed XML).
To set stylesheet parameters from the command line, use
TestXSLT -PARAM name expression
To set the parameter to a string value, enclose the string in single quotes (') to
make it an expression.