Command-Line Processors

The exact details of how to install, configure, and run the XSLT processor naturally vary from processor to processor. Generally, you have to install the processor in your path, or add its jar file to your class path if it’s written in Java. Then you pass in the names of the input file, stylesheet file, and output file on the command line. For example, using Xalan, Example 8-3 is created in this fashion:

% java org.apache.xalan.xslt.Process -IN people.xml -XSL minimal.xsl
                  
                     -OUT 8-3.txt
                  
= = = = = = = = = Parsing file:D:/books/xian/examples/08/minimal.xsl = = = = = = = = = =
Parse of file:D:/books/xian/examples/08/minimal.xsl took 771 milliseconds
= = = = = = = =  = Parsing people.xml = = = = = = = = = =
Parse of people.xml took 90 milliseconds
= = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Transforming...
transform took 20 milliseconds
XSLProcessor: done

For exact details, you’ll need to consult the documentation that comes with your XSLT processor.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.