Outputting the Results

So, how do you get output from the XSL processor? The answer depends on how you invoke the processor. For our purposes, let’s assume that this is a static style sheet stored in a file called invoice.xsl. Now, you can attach the style to the XML source document in one of two ways. The easiest is to include an <?xml-stylesheet> directive in the source document. If you leaf back to Listing 2.1, you’ll notice the following statement at the top of the listing:

<?xml-stylesheet type="text/xsl" href="invoice.xsl"?> 

When the XML parser sees this line, invoice.xsl is loaded and applied to the source document. The resulting output is shown in Listing 2.4.

Listing 2.4. Output from the XSLT Processor
 <HTML> <HEAD> <TITLE>First ...

Get Special Edition Using XSLT now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.