<?xml version="1.0"?>
<TEI.2>
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>XSL stylesheets for TEI XML</title>
        <author>Sebastian Rahtz</author>
      </titleStmt>
      <publicationStmt>
        <p> </p>
      </publicationStmt>
      <sourceDesc>
        <p></p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
         <change>
            <date>$Date: 2009-06-05 13:24:45 +0100 (Fri, 05 Jun 2009) $.</date>
            <respStmt>
               <name>$Author: rahtz $</name>
            </respStmt>
            <item>$Revision: 6500 $</item>
         </change>
    </revisionDesc>
  </teiHeader>
  <text>
<body>
<div><head>Introduction</head>
<p>This is a set of XSLT specifications to transform TEI XML documents
to XHTML, to LaTeX, to XSL Formatting Objects and to OOXML (docx)
format.  The files can be downloaded from the Releases area of <xptr
url="http://tei.sf.net"/>.  They concentrates on the simpler TEI
modules, but adding support for other modules is fairly easy. In the
main, the setup has been used on <q>new</q> documents, ie reports and
web pages that have been authored from scratch, rather than
traditional TEI-encoded existing material.
</p>

<p>There is a <xref url="ChangeLog">change log</xref> file
available.</p>

<p>The stylesheets have internal documentation, using
<xref url="http://www.pnp-software.com/">P&amp;P Software</xref>'s
XSLTdoc system; the results can be browsed in the <xref
url="xsltdoc/">technical documentation</xref> section.</p>

<p>The XSL FO style sheets were developed for use with PassiveTeX (<xptr
url="http://www.tei-c.org/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.</p>
</div>

<div>
<head>File organisation</head>
<p>The stylesheets are divided into four directories:
<list type="gloss">
<label>common2</label><item>templates which are independent of output type</item>
<label>fo2</label><item>templates for making XSL FO output</item>
<label>html2</label><item>templates for making HTML output</item>
<label>latex2</label><item>templates for making LaTeX output</item>
</list>
Within each directory there is a separate file for the templates
which implement each of the TEI modules (eg
<ident>textstructure.xsl</ident>,
<ident>linking.xsl</ident>, or <ident>drama.xsl</ident>); these
are included by a master file <ident>tei.xsl</ident>. This also
includes a parameterization layer in the file
<ident>tei-param.xsl</ident>, and the parameterization file from
the <ident>common</ident> directory. The <ident>tei.xsl</ident> does
any necessary declaration of constants and XSL keys.</p>
<p>The normal method of use is to decide which if the three output methods
is wanted, and then reference the corresponding <ident>tei.xsl</ident>
file. Any other use of the stylesheets, eg by referencing individual
modules, is not supported and requires good understanding of XSL.</p>
</div>

<div><head>Customization</head>
<p>
  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 <xref url="customize.xml">Customization Handbook</xref>.
  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.
</p>
<p>The <xref url="style.xml">Stylebear</xref> web form
will construct a XSL file for you, with all the variables configured.
</p>

</div>


<div>
<head>XSLT processors</head>
<p>
The stylesheets have been tested at various times with the Microsoft,
XT, Saxon, jd, libxslt, Xalan, Sablotron and Oracle XSLT processors;
they were converted to use XSLT 2.0 in 2009, and so now only work with

Saxon (from <xptr url="http://saxon.sourceforge.net"/>). XSLT 1.0
stylesheets are also available, but will not be further maintained. 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.</p>
</div>

</body>
<back>
</back>
</text>
</TEI.2>

