home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeXML in a NutshellSearch this book

8.3. Stylesheet Processors

An XSLT processor is a piece of software that reads an XSLT stylesheet, reads an input XML document, and builds an output document by applying the instructions in the stylesheet to the information in the input document. An XSLT processor can be built into a web browser, just as MSXML is in Internet Explorer 6. It can be built into a web or application server, as in the Apache XML Project's Cocoon (http://xml.apache.org/cocoon). Or it can be a standalone program run from the command like Michael Kay's SAXON (http://saxon.sourceforge.net) or the Apache XML Project's Xalan (http://xml.apache.org/xalan-j/ ).

8.3.1. 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
transform took 20 milliseconds
XSLProcessor: done

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

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.