XSL stylesheets for TEI XML
- File organisation
- Documentation of conversions and start points
- Notes on XSLT processors and XSL FO
- cover all TEI elements and possible attribute values
- attempt to define a standard TEI processing or rendering model
- templates which are independent of output type, used by the other transformations
- templates for making HTML output (also used for ePub)
- templates for making LaTeX output
- conversion to and from Word OOXML format
- conversion to and from OpenOffice ODF format
- templates for making XSL FO output
- processing of TEI ODD files
- conversion to BibTeX
- conversion to/from Docbook
- ODD conversion to DTD
- conversion to ePub
- conversion to ePub3
- conversion to HTML5
- conversion to JSON
- conversion to NLM
- conversion to RDF (CIDOC CRM)
- conversion to LaTeX and HTML slides
- conversion to TBX
- conversion from Text Creation Partnership P4 XML
- conversion from TEI Tite to normal TEI P5
- conversion to plain text
- 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)
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.