XSL stylesheets for TEI XML
Contents
Introduction
This is a set of XSLT specifications to transform TEI XML documents to HTML, to LaTeX, and to XSL Formatting Objects. It can be downloaded from the Releases area of the TEI SourceForge site. It concentrates on TEI Lite, but adding support for other modules is fairly easy. These stylesheets are primarily for use on ‘new’ documents, i.e. reports and web pages that have been authored from scratch, rather than traditional TEI-encoded existing material.
The stylesheets have internal documentation, using P&P Software's XSLTdoc system; the results can be browsed in the technical documentation section.
The XSL FO stylesheets were developed for use with PassiveTeX ( http://www.tei-c.org.uk/Software/passivetex/ ), a system using XSL formatting objects to render XML to PDF via LaTeX. They have not been extensively tested with the other XSL FO implementations.
Questions about these stylesheets should be directed to the TEI-L mailing list, or to their author, Sebastian Rahtz.
File organization
- common
- templates which are independent of output type
- fo
- templates for making XSL FO output
- html
- templates for making HTML output
- latex
- templates for making LaTeX output
The normal method of use is to decide which of the three output methods is wanted, and then reference the corresponding tei.xsl file. Any other use of the stylesheets, e.g. by referencing individual modules, is not supported and requires good understanding of XSL.
Customization
The TEI stylesheets are designed to be customized, more parameterization will be added in future. There are currently several hundred things you can set to change the output, described in the Customization Handbook. They are either XSLT variables, or named templates, so you need to understand a little of XSL syntax. If you know a bit more, you can override any of the templates in the style files, but then you are on your own.
The Stylebear web form will construct an XSL file for you, with all the variables configured.
XSLT processors
The stylesheets have been tested at various times with the Microsoft, XT, Saxon, jd, libxslt, Xalan, Sablotron and Oracle XSLT processors; but at present the ones which are known to work fully are Xalan, Saxon and libxslt. The Microsoft processor can be used, but does not support multiple file output, which means that you cannot use the `split' feature of the stylesheets to make multiple HTML files from one XML file. There are ways to achieve the same effect, if you know what you are doing, using Javascript.
If you have not yet installed an XSLT processor, it is probably sensible to pick Mike Kay's Saxon (from http://saxon.sourceforge.net ) or Daniel Veillard's libxslt (from http://www.xmlsoft.org ), as they seem to be the best implementations of the specification. It is up to the user to find out how to run the XSLT processor; this may be from within a Java program, on the command-line, or inside a web server.