This presentation is an introduction to transforming XML documents using XSLT.
XSLT - Transforming XML with XSLT.
Sample XSL files - Sample XSL files you can use as examples to building your own files and learning more about XSLT.
Note that the examples in these chapters are almost all based on the tigers_rhinos.xml and tigers_complete.xsl files. The XSLT files gradually build up to the tigers_complete.xsl file, with minor changes depending on the topic in question. For maximum effect, you'll also need the tiger.jpg and rhino.jpg images.
The files in this section are in the xslt folder. Note that all of these XSLT files transform the very same tigers_rhinos.xml file. The HTML files shown were generated by transforming the tigers_rhinos.xml file with the given XSLT file, using Saxon.
| Page | Section | Code |
|---|---|---|
| 136-137 | Transforming XML with XSLT | Figure 10.1: tigers_rhinos.xml Figure 10.3: tigers_complete.xsl |
| 138 | Beginning an XSLT Style Sheet | begin.xsl |
| 139 | Creating the Root Template | root.xsl, root.xml |
| 140-141 | Outputting HTML Code | html.xsl, html.html |
| 142-143 | Outputting a Node's Content | node.xsl, node.html |
| 144-145 | Creating and Applying Template Rules | templates.xsl, templates.html |
| 146-147 | Batch-Processing Nodes | for-each.xsl, for-each.html |
| 148 | Processing Nodes Conditionally | if.xsl, if.html |
| 149 | Adding Additional Choices | choose.xsl, choose.html |
| 150 | Sorting Nodes Before Processing | sort.xsl, sort.html |
| 151 | Generating Attributes | attributes.xsl, attributes.html |
Click here to return to the course outline.
Last revision September 10, 2001
http://www.informaticus.org/COIN78/week7/index.htm