<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 1. DocBook XSL</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.37"><link rel="home" href="index.html" title="DocBook XSL Stylesheet Documentation"><link rel="up" href="index.html" title="DocBook XSL Stylesheet Documentation"><link rel="previous" href="pr01.html" title="Preface"><link rel="next" href="ch01s02.html" title="A brief introduction to XSL"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. DocBook XSL</th></tr><tr><td width="20%" align="left"><a href="pr01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a href="ch01s02.html">Next</a></td></tr></table><hr></div><p>There is a growing list of tools to process DocBook
documents using XSL stylesheets. Each tool implements parts
or all of the XSL standard, which actually has several
components:
<div class="variablelist"><dl><dt><a name="c44b1b3b4b2b2b1"></a><span class="term">Extensible Stylesheet Language (XSL)</span></dt><dd><p><a name="c44b1b3b4b2b2b1b2"></a>A language for expressing stylesheets written
in XML. It includes the formatting object language, but
refers to separate documents for the transformation
language and the path language.</p></dd><dt><a name="c44b1b3b4b2b2b2"></a><span class="term">XSL Transformation (XSLT)</span></dt><dd><p><a name="c44b1b3b4b2b2b2b2"></a>The part of XSL for transforming XML documents
into other XML documents, HTML, or text. It can be used to
rearrange the content and generate new content.</p></dd><dt><a name="c44b1b3b4b2b2b3"></a><span class="term">XML Path Language (XPath)</span></dt><dd><p><a name="c44b1b3b4b2b2b3b2"></a>A language for addressing parts of an XML
document. It is used to find the parts of your document to
apply different styles to. All XSL processors use this
component.</p></dd></dl></div></p><p>To publish HTML from your XML documents, you just
need an XSLT engine. To get to print, you need an XSLT
engine to produce formatting objects (FO), which then must
be processed with a formatting object processor to produce
PostScript or PDF output.</p><p>James Clark's XT was the first useful XSLT engine,
and it is still in wide use. It is written in Java, so it
runs on many platforms, and it is free (
XT comes with James Clark's nonvalidating parser XP, but
you can substitute a different Java parser. Here is a
simple example of using XT from the Unix command line to
produce HTML: You'll need to alter your
<i><tt>CLASSPATH</tt></i> environment variable to
include the path to where you put the
<tt>.jar</tt> files from the XT
distribution.</p><pre class="screen">CLASSPATH=xt.jar:xp.jar:sax.jar
export CLASSPATH
java com.jclark.xsl.sax.Driver <i><tt>filename.xml</tt></i> <i><tt>docbook/html/docbook.xsl</tt></i> > <i><tt>output.html</tt></i></pre><p>If you replace the HTML stylesheet with a
formatting object stylesheet, XT will produce a formatting
object file. Then you can convert that to PDF using FOP, a
formatting object processor available for free from the
Apache XML Project (
Here is an example of that two stage processing:</p><pre class="screen">CLASSPATH=xt.jar:xp.jar:sax.jar:fop.jar
export CLASSPATH
java com.jclark.xsl.sax.Driver <i><tt>filename.xml</tt></i> <i><tt>docbook/fo/docbook.xsl</tt></i> > <i><tt>output.fo</tt></i>
java org.apache.fop.apps.CommandLine <i><tt>output.fo</tt></i> <i><tt>output.pdf</tt></i></pre><p>As of this writing, some other XSLT processors to
choose from include:</p><div class="itemizedlist"><ul><li><p><a name="c44b1b3b4b9b1"></a>4XSLT, written in Python, from FourThought LLC (
Project (
Egon Willighagen (
<a href="http://www.cpan.org" target="_top">http://www.cpan.org</a>)</p></li></ul></div><p>For print output, these additional tools are available for processing formatting objects:</p><div class="itemizedlist"><ul><li><p><a name="c44b1b3b4c11b1"></a>XEP (written in Java) from
RenderX (
<a href="http://www.renderx.com" target="_top">http://www.renderx.com</a>).</p></li><li><p><a name="c44b1b3b4c11b2"></a>PassiveTeX from Sebastian Rahtz (<a href="http://users.ox.ac.uk/~rahtz/passivetex/" target="_top">http://users.ox.ac.uk/~rahtz/passivetex/</a>).</p></li></ul></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a href="pr01.html">Prev</a> </td><td width="20%" align="center"><a href="index.html">Home</a></td><td width="40%" align="right"> <a href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left">Preface </td><td width="20%" align="center"><a href="index.html">Up</a></td><td width="40%" align="right"> A brief introduction to XSL</td></tr></table></div></body></html>