summaryrefslogtreecommitdiffstats
path: root/lib/docbook/docbook-xsl/doc/publishing.html
blob: d285bfdcd87a103946560a130431fcc079b2b3c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<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 V2"><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 accesskey="p" href="pr01.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="d0e31"></a>Chapter 1. DocBook XSL</h2></div><div><h3 class="author">Bob Stayton</h3></div><div><p class="releaseinfo">
$Id: publishing.html,v 1.1 2002/05/15 17:22:23 isberg Exp $
</p></div><div><p class="copyright">Copyright &copy; 2000 Bob Stayton</p></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="publishing.html#d0e52">Using XSL tools to publish DocBook
   documents</a></dt><dt><a href="ch01s02.html">A brief introduction to XSL</a></dt><dt><a href="ch01s03.html">XSL processing model</a></dt><dt><a href="ch01s04.html">Customizing DocBook XSL stylesheets</a></dt></dl></div><div class="sect1"><a name="d0e52"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e52"></a>Using XSL tools to publish DocBook
   documents</h2></div></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="d0e58"></a><span class="term">Extensible Stylesheet Language (XSL)</span></dt><dd><p><a name="d0e61"></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="d0e64"></a><span class="term">XSL Transformation (XSLT)</span></dt><dd><p><a name="d0e67"></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="d0e70"></a><span class="term">XML Path Language (XPath)</span></dt><dd><p><a name="d0e73"></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 (
   <a href="http://www.jclark.com" target="_top">http://www.jclark.com</a>).
   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> &gt; <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 (
   <a href="http://xml.apache.org" target="_top">http://xml.apache.org</a>).
   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> &gt; <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="d0e123"></a>4XSLT, written in Python, from FourThought LLC (
     <a href="http://www.fourthought.com" target="_top">http://www.fourthought.com</a>)</p></li><li><p><a name="d0e129"></a>Sablotron, written in C++, from Ginger Alliance (

     <a href="http://www.gingerall.com" target="_top">http://www.gingerall.com</a>)</p></li><li><p><a name="d0e135"></a>Saxon, written in Java, from Michael Kay (
     <a href="http://users.iclway.co.uk/mhkay/saxon" target="_top">http://users.iclway.co.uk/mhkay/saxon</a>)</p></li><li><p><a name="d0e141"></a>Xalan, written in Java, from the Apache XML
     Project (
     <a href="http://xml.apache.org" target="_top">http://xml.apache.org</a>)</p></li><li><p><a name="d0e147"></a>XML::XSLT,written in Perl, from Geert Josten and
     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="d0e156"></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="d0e162"></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></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pr01.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left">Preface&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;A brief introduction to XSL</td></tr></table></div></body></html>