A Simple XSLT stylesheet to convert TEI documents to HTML.
This stylesheet quite strongly depends on the particular conventions used to mark-up the document, and requires a number of supplementary files.
Use the following commands to process a file:
saxon akbar.xml tei2html.xsl > akbar.html
The stylesheets are localised in Dutch, English, and Spanish. All localized messages are in a file messages.xml
. The language used in the result depends on the lang
attribute of the toplevel TEI.2
tag. If you localise the messages in other languages, please send these to me for inclusion in this distribution.
This stylesheet assumes the CSS-stylesheets gutenberg.css.xml
and artic.css.xml
are available in a directory /style
below the directory where the HTML file resides. These are normal CSS-stylesheets, but are wrapped in a single XML tag, for use with XSLT. The stylesheets are required to display the results, and will, among many other things, move the page numbers and marginal notes into the margin.
Illustrations are assumed to named after the //figure/@id
, have the .jpg
extension and assumed to be located in the /images
directory below the directory where the HTML file resides. If this is troublesome, you can add a the string file(url of image)
in the rend
attribute of the figure
element.
Footnotes are moved to the end of the div1
element they appear in, unless the div1
is inside a q
element. Footnotes that appear in a div0
element are placed at the end of the div0
element, but only if it contains no div1
elements. This is buggy, and assumes that div0
elements are normally not used.
Notes with the place
attribute set to margin
will be placed in the left margin.
To call this style directly from an XML document, include the following lines at the top of your document:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="style/tei2html.xsl"?>
This has been tested with the Saxon XSLT processor, and also seems to work with Internet Explorer 6.0 and the latest Mozilla browsers, although IE doesn't seem to handle spaces correctly in all situations, and Mozilla has an issue with output escaping.
Any comments and questions can be send to Jeroen Hellingman, jeroen@bohol.ph.