





















|
| |
Call the testXSLT executable with the 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 testXSLT executable can take the following flags and arguments (the flags are case insensitive):
 |  |  |  | -IN inputXMLURL
-XSL XSLTransformationURL
-OUT outputFileName
-H (Display list of command-line options)
-? (Display list of command-line options)
-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)
-VALIDATE (Validate the XSL and XML input -- default is not to validate)
-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)
The -XML flag must be set:
-NH (Don't write XML header)
-HTML (Use HTML formatter)
The -HTML flag must be set:
-NOINDENT (turns off HTML indenting)
The -XML or -HTML flag must be set:
-STRIPCDATA (Strip CDATA sections of their brackets, but do not escape)
-ESCAPECDATA (Strip CDATA sections of their brackets, and escape)
-TEXT (Use simple Text formatter)
-DOM (Test for well-formed output --format to DOM then to XML for output)
-XST (Format to Xalan source tree, then to XML for output)
-XD (Use Xerces DOM instead of Xalan source tree)
-DE Disable built-in extension functions)
-EN (Specify the namespace URI for Xalan extension functions; the default
is 'http://xml.apache.org/xslt')
-PARAM name expression (Set a stylesheet parameter) |  |  |  |  |
Use -IN to specify the XML source document.
Use -XSL to specify the XSL stylesheet file.
Use -DE not to load the standard set of extension functions.
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.
|
 |  |  |  | Enabling ICU support for the Xalan executable and/or testXSLT |  |  |  |  |
| |
You can set up the International Components for Unicode (ICU) to enhance the support that Xalan-C++ provides for encoding, number
formatting, and sorting. For more information, see Using the ICU.
If you have built and integrated the ICU with Xerces-C++, Xalan and testXSLT (like any Xalan-C++ application) automatically uses ICU
support for output encoding. See Building ICU for Xerces-C++.
The Xalan and testXSLT executables also conditionally include ICU support for number formatting and sorting. For Xalan, look in XalanTransformer.cpp
for the #if defined(XALAN_USE_ICU) blocks. For testXSLT, look in process.cpp for the
#if defined(XALAN_USE_ICU) blocks. These blocks #include the ICUBridge headers, and
substitutes ICU support for xsl:number, format-number(), and xsl:sort. To activate this support:
- Download and build the ICU (see Using the ICU).
- Rebuild Xalan and or testXSLT with the ICU enabled (see below).
 |  |  |  | Rebuilding Xalan and/or TestXSLT in Windows |  |  |  |  |
| |
- Uncomment the
#define XALAN_USE_ICU in XalanTransformer.cpp and/or process.cpp.
- Add ICUBridge to the Visual C++ list of dependencies for the XalanTransformer and/or TestXSLT project.
- Build Xalan.exe and/or TestXSLT.exe.
|
 |  |  |  | Rebuilding Xalan and/or testXSLT in UNIX |  |  |  |  |
| |
In the Linux, AIX, HP-UX 11, and Solaris builds, the ICUBridge is in the core Xalan library (libxalan-c1_4.so in Linux; libxalan-c1_4.a in
AIX; libxalan-c1_4.sl in HP-UX 11; libxalan-c1_4.so in Solaris ), so you must rebuild this library along with Xalan and/or testXSLT.
Before you do the build, define the XALAN_USE_ICU environment variable. For information about defining this
environment variable and doing a build, see Steps for doing a
UNIX build.
 | The make file uses the XALAN_USE_ICU environment variable to do the equivalent of a #define and to add
ICUBridge to the list of dependencies for testXSLT. If you uncomment the #define XALAN_USE_ICU
statement in process.cpp (which is the right thing to do in Windows), you will get an error in AIX ("The
macro 'XALAN_USE_ICU' has already been defined"), an error in HP-UX 11 ("Redefinition of macro 'XALAN-USE_ICU'
differs from previous definition"), or a warning in Linux or Solaris about duplicate settings when you
run the make, and testXSLT does not link with ICUBridge. |
|
|
|
|