XSL stylesheets for TEI XML
Contents
- Introduction
- File organisation
- Documentation of conversions and start points
- Customization
- Notes on XSLT processors and XSL FO
Introduction
- cover all TEI elements and possible attribute values
- attempt to define a standard TEI processing or rendering model
File organisation
- common2
- templates which are independent of output type, used by the other transformations
- xhtml2
- templates for making HTML output (also used for ePub)
- latex2
- templates for making LaTeX output
- docx
- conversion to and from Word OOXML format
- odt
- conversion to and from OpenOffice ODF format
- fo2
- templates for making XSL FO output
- odds2
- processing of TEI ODD files
- bibtex
- conversion to BibTeX
- docbook
- conversion to/from Docbook
- dtd
- ODD conversion to DTD
- epub
- conversion to ePub
- epub3
- conversion to ePub3
- html5
- conversion to HTML5
- json
- conversion to JSON
- nlm
- conversion to NLM
- rdf
- conversion to RDF (CIDOC CRM)
- slides
- conversion to LaTeX and HTML slides
- tbx
- conversion to TBX
- tcp
- conversion from Text Creation Partnership P4 XML
- tite
- conversion from TEI Tite to normal TEI P5
- txt
- conversion to plain text
- xlsx
- conversion from Microsoft Office spreadsheet format
The final important directory is profiles, which has a set of predefined project starting points, each of which may have a file to.xsl for one or more of the supported output formats (csv, docbook, docx, dtd, epub3, epub, fo, html5, html, ibooks, json, latex, lite, oddhtml, odt, p4, rdf, relaxng, tcp, txt, and xlsx). There may also be a from.xsl to go from the selected format to TEI XML.
For example, to convert TEI to HTML in the default mannner, the user may run profiles/default/html/to.xsl on the selected input file. Other starting points are listed below.
For the brave, there are Linux/OSX command-line shell scripts docbooktotei, docxtotei, odttotei, tcptotei, teitobibtex, teitodocbook, teitodocx, teitodtd, teitoepub, teitoepub3, teitofo, teitohtml, teitohtml5, teitojson, teitolatex, teitoodd, teitoodt, teitopdf, teitordf, teitorelaxng, teitornc, teitoslides, teitotxt, teitoxsd, and xlsxtotei for converting to/from Word, to/from OpenOffice, and to DTD, ePub, HTML, RDF, Relax NG, plain text, W3C schema etc. These are implemented using Ant tasks, which are also available within the oXygen XML editor as part of the TEI framework.
Any other use of the stylesheets, eg by referencing individual modules, requires good understanding of XSL.
Documentation of conversions and start points
- Default conversion from CSV
- Default conversion to CSV
- Default conversion to Docbook
- Default conversion from docx (OOXML)
- Default conversion to docx (OOXML)
- Default conversion to ePub
- Default conversion to XSL FO
- Default conversion to XHTML
- Default conversion to LaTeX
- Default conversion from OpenOffice (odt)
- Default conversion to OpenOffice (odt)
- Default conversion from TEI P4
- Conversion from TCP EEBO
- Conversion of ODD file to expanded ODD
- Conversion of ODD to RELAX NG schema
- Conversion of ODD to DTD
- Default conversion to HTML slides
- Default conversion to LaTeX slides (using beamer package)
Customization
The TEI stylesheets are designed to be customized, and I will gladly add more parameterization 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 a XSL file for you, with all the variables configured.
Notes on XSLT processors and XSL FO
These stylesheets use XSLT 2.0, and have only been tested with Saxon (from http://saxon.sourceforge.net ). An older set of XSLT 1.0 stylesheets are also available, but is not maintained or updated.
It is up to the user to find out how to run the XSLT processor! This may be from within a Java program, from your editor, on the command-line, or inside a web server.
The XSL FO style sheets were developed for use with PassiveTeX ( http://projects.oucs.ox.ac.uk/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.


