<?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: 2005-05-22 05:45:25 +0100 (Sun, 22 May 2005) $.</date>
            <respStmt>
               <name>$Author: rahtz $</name>
            </respStmt>
            <item>$Revision$</item>
         </change>
    </revisionDesc>
  </teiHeader>
  <text>
<body>
<div><head>Introduction</head>
<p>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 <xptr url="http://tei.sf.net"/>.
It concentrates on TEI Lite, 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>common</label><item>templates which are independent of output type</item>
<label>fo</label><item>templates for making XSL FO output</item>
<label>html</label><item>templates for making HTML output</item>
<label>latex</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;
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. </p>

<p>If you have not yet installed an XSLT processor, it is probably
sensible to pick Mike Kay's Saxon (from <xptr
url="http://saxon.sourceforge.net"/>) or Daniel Veillard's libxslt
(from <xptr url="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.</p>
</div>

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

