Abbey Workshop | ||||||||||
This tip provides of a couple examples of simple XSLT stylesheets. Both templates are designed to tranform the student_directory.xml file. The XML file represent a student directory from a fictional college. The first stylesheet converts the file into text, the second converts the file into an HTML page.
Download source for: student_directory.xml

This stylesheet converts the XML file into a text file. The default output method of XSLT is XML. Therefore, the xsl:output tag is used to tell the processor to output to text.
Download source for: student_text.xsl
Here is the output from the transformation.
Download source for: student.txt

This stylesheet converts the XML file into an HTML file. Note that any HTML must be well formed to be stored in the an XSLT stylesheet. Most transformation engines will automatically remove trailing slashes to make the HTML work better with the browser.
Download source for: student_html.xsl
Here is the HTML file produced from the transformation.
Download source for: student.html
Copyright © Abbey Workshop 2006