Here are some files which form a demonstration of LaTeX reading XSL Formatting Objects and processing them to produce nice pages. They rely heavily on earlier work by David Carlisle (his typehtml for typesetting HTML files), and on my JadeTeX for processing DSSSL via Jade. David has also contributed a place-holder package for dealing with UTF-8 encoding. It is expected that all the components will be replaced in the near future.
How does it work? Taking the XML version of the TEI Lite guidelines (teiu5.xml, with DTD teixlite.dtd), we apply an XSL stylesheet (see my page of TEI style sheets), and run it through James Clarks' XT XSL processor (version of 19990926 or later):
java com.jclark.xsl.sax.Driver teiu5.xml tei.xsl teiu5.fo(assuming you have xt.jar, xp.jar and sax.jar on your CLASSPATH ). This creates the new XML file teiu5.fo. We now run a special TeX on this
pdftex "&fotex" teiu5.fowhich creates teiu5.pdf. Voila! Actually, we need to do
pdftex "&fotex" teiu5.foagain, to resolve page-number references in the table of contents. For a comparison with an HTML rendering of the same document (using XSL again), see teiu5.html on my TEI page.
How did we make fotex.fmt? With the command
pdftex -ini "&pdflatex" pdffotex.iniFor this you need fotex.ltx, pdffotex.ini, typexml.sty, mathml.ltx, unicode.sty, ucharacters.sty, dummyels.sty, mlnames.sty, and utfeight.sty, as well as version 6.65 or later of the hyperref package (actually, you just need hyperref.sty and hpdftex.def).
These files are available zipped up.
NOTE: TeX has a limit on the length of line it can read, and some .fo files you generate may cause TeX to die with an message about increasing buf_size. If you get that, edit your texmf.cnf file, increase the size of buf_size (mine is 200000), and remake pdflatex.fmt and then fotex.fmt.
<xsl:template match="div2">
<xsl:apply-templates select="head"/>
<fotex:bookmark
xmlns:fotex="http://www.tug.org/fotex"
fotex-bookmark-level="2"
fotex-bookmark-label="{@id}">
<xsl:value-of select="head"/>
</fotex:bookmark>
</fo:block>
</xsl:template>
Some points to bear in mind
I will be very glad to discuss details with anyone. Contact me (Sebastian Rahtz) as sebastian.rahtz@oucs.ox.ac.uk
Last updated $Date: 1999/12/21 12:25:31 $