Blob Blame History Raw
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<texinfoset xmlns="http://docbook2x.sourceforge.net/xmlns/Texi-XML"><nodenamemap>
<nodenamemapentry id="docbook2X" file="docbook2X"><nodename>Top</nodename></nodenamemapentry>
<nodenamemapentry id="quickstart" file="docbook2X"><nodename>Quick start</nodename></nodenamemapentry>
<nodenamemapentry id="manpages" file="docbook2X"><nodename>Converting to man pages</nodename></nodenamemapentry>
<nodenamemapentry id="docbook2man" file="docbook2X"><nodename>docbook2man wrapper script</nodename></nodenamemapentry>
<nodenamemapentry id="db2x_manxml" file="docbook2X"><nodename>db2x_manxml</nodename></nodenamemapentry>
<nodenamemapentry id="db2x_manxml_name" file="docbook2X"><nodename>db2x_manxml_name</nodename></nodenamemapentry>
<nodenamemapentry id="texinfo" file="docbook2X"><nodename>Converting to Texinfo</nodename></nodenamemapentry>
<nodenamemapentry id="docbook2texi" file="docbook2X"><nodename>docbook2texi wrapper script</nodename></nodenamemapentry>
<nodenamemapentry id="db2x_texixml" file="docbook2X"><nodename>db2x_texixml</nodename></nodenamemapentry>
<nodenamemapentry id="db2x_texixml_name" file="docbook2X"><nodename>db2x_texixml_name</nodename></nodenamemapentry>
<nodenamemapentry id="xsltproc" file="docbook2X"><nodename>The XSLT stylesheets</nodename></nodenamemapentry>
<nodenamemapentry id="xsltproc.db2x_manxml" file="docbook2X"><nodename>Convert to man pages using pure-XSLT db2x_manxml</nodename></nodenamemapentry>
<nodenamemapentry id="xsltproc.db2x_texixml" file="docbook2X"><nodename>Convert to Texinfo using Pure-XSLT db2x_texixml</nodename></nodenamemapentry>
<nodenamemapentry id="db2x_xsltproc" file="docbook2X"><nodename>db2x_xsltproc</nodename></nodenamemapentry>
<nodenamemapentry id="db2x_xsltproc_name" file="docbook2X"><nodename>db2x_xsltproc_name</nodename></nodenamemapentry>
<nodenamemapentry id="sgml2xml-isoent" file="docbook2X"><nodename>sgml2xml-isoent</nodename></nodenamemapentry>
<nodenamemapentry id="sgml2xml-isoent_name" file="docbook2X"><nodename>sgml2xml-isoent_name</nodename></nodenamemapentry>
<nodenamemapentry id="charsets" file="docbook2X"><nodename>Character set conversion</nodename></nodenamemapentry>
<nodenamemapentry id="utf8trans" file="docbook2X"><nodename>utf8trans</nodename></nodenamemapentry>
<nodenamemapentry id="utf8trans_name" file="docbook2X"><nodename>utf8trans_name</nodename></nodenamemapentry>
<nodenamemapentry id="faq" file="docbook2X"><nodename>FAQ</nodename></nodenamemapentry>
<nodenamemapentry id="performance" file="docbook2X"><nodename>Performance analysis</nodename></nodenamemapentry>
<nodenamemapentry id="testing" file="docbook2X"><nodename>How docbook2X is tested</nodename></nodenamemapentry>
<nodenamemapentry id="todo" file="docbook2X"><nodename>To-do list</nodename></nodenamemapentry>
<nodenamemapentry id="changes" file="docbook2X"><nodename>Release history</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.8" file="docbook2X"><nodename>docbook2X 0_8_8</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.7" file="docbook2X"><nodename>docbook2X 0_8_7</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.6" file="docbook2X"><nodename>docbook2X 0_8_6</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.5" file="docbook2X"><nodename>docbook2X 0_8_5</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.4" file="docbook2X"><nodename>docbook2X 0_8_4</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.3" file="docbook2X"><nodename>docbook2X 0_8_3</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.2" file="docbook2X"><nodename>docbook2X 0_8_2</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.1" file="docbook2X"><nodename>docbook2X 0_8_1</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.8.0" file="docbook2X"><nodename>docbook2X 0_8_0</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.7.0" file="docbook2X"><nodename>docbook2X 0_7_0</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.6.9" file="docbook2X"><nodename>docbook2X 0_6_9</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.6.1" file="docbook2X"><nodename>docbook2X 0_6_1</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.6.0" file="docbook2X"><nodename>docbook2X 0_6_0</nodename></nodenamemapentry>
<nodenamemapentry id="changes-0.5.9" file="docbook2X"><nodename>docbook2X 0_5_9</nodename></nodenamemapentry>
<nodenamemapentry id="design-notes" file="docbook2X"><nodename>Design notes</nodename></nodenamemapentry>
<nodenamemapentry id="xslt-extensions-move" file="docbook2X"><nodename>Design notes: the       elimination of XSLT extensions</nodename></nodenamemapentry>
<nodenamemapentry id="install" file="docbook2X"><nodename>Package installation</nodename></nodenamemapentry>
<nodenamemapentry id="install-procedure" file="docbook2X"><nodename>Installation</nodename></nodenamemapentry>
<nodenamemapentry id="install-problems" file="docbook2X"><nodename>Installation problems</nodename></nodenamemapentry>
<nodenamemapentry id="dependencies" file="docbook2X"><nodename>Dependencies on other software</nodename></nodenamemapentry>
<nodenamemapentry id="cindex" file="docbook2X"><nodename>Concept index</nodename></nodenamemapentry></nodenamemap><texinfo file="docbook2X"><settitle>docbook2X</settitle><directory category="Document Preparation"><menuentry file="docbook2X"><menuentrytitle>docbook2X</menuentrytitle><menuentrydescrip>Convert DocBook into man pages and Texinfo</menuentrydescrip></menuentry></directory><node id="docbook2X" previousid="" nextid="quickstart"/><documentlanguage lang="en"/><top>docbook2X</top><indexterm class="cp">DocBook</indexterm><para>
    <i>docbook2X</i> converts 
    DocBook
    documents into man pages and 
    Texinfo documents.
  </para><para>
    It aims to support DocBook version 4.2, excepting the features
    that cannot be supported or are not useful in a man page or 
    Texinfo document.
  </para><indexterm class="cp">web site</indexterm><indexterm class="cp">download</indexterm><para>
    For information on the latest releases of docbook2X, and downloads,
    please visit the <uref url="http://docbook2x.sourceforge.net/">docbook2X home page</uref>.
  </para><menu><menuentry idref="quickstart"><menuentrytitle>Quick start</menuentrytitle><menuentrydescrip>Examples to get you started</menuentrydescrip></menuentry><menuentry idref="manpages"><menuentrytitle>Converting to man pages</menuentrytitle><menuentrydescrip>Details on man-page conversion</menuentrydescrip></menuentry><menuentry idref="texinfo"><menuentrytitle>Converting to Texinfo</menuentrytitle><menuentrydescrip>Details on Texinfo conversion</menuentrydescrip></menuentry><menuentry idref="xsltproc"><menuentrytitle>The XSLT stylesheets</menuentrytitle><menuentrydescrip>How to run the docbook2X XSLT stylesheets</menuentrydescrip></menuentry><menuentry idref="charsets"><menuentrytitle>Character set conversion</menuentrytitle><menuentrydescrip>Discussion on reproducing non-ASCII characters in the 
        converted output</menuentrydescrip></menuentry><menuentry idref="faq"><menuentrytitle>FAQ</menuentrytitle><menuentrydescrip>Answers and tips for common problems</menuentrydescrip></menuentry><menuentry idref="performance"><menuentrytitle>Performance analysis</menuentrytitle><menuentrydescrip>Discussion on conversion speed</menuentrydescrip></menuentry><menuentry idref="testing"><menuentrytitle>How docbook2X is tested</menuentrytitle><menuentrydescrip>Discussion of correctness-testing</menuentrydescrip></menuentry><menuentry idref="todo"><menuentrytitle>To-do list</menuentrytitle><menuentrydescrip>Ideas for future improvements</menuentrydescrip></menuentry><menuentry idref="changes"><menuentrytitle>Release history</menuentrytitle><menuentrydescrip>Changes to the package between releases</menuentrydescrip></menuentry><menuentry idref="design-notes"><menuentrytitle>Design notes</menuentrytitle><menuentrydescrip>Author’s notes on the grand scheme of docbook2X</menuentrydescrip></menuentry><menuentry idref="install"><menuentrytitle>Package installation</menuentrytitle><menuentrydescrip>Where to get docbook2X, and details on how to install
        it</menuentrydescrip></menuentry><menuentry idref="cindex"><menuentrytitle>Index</menuentrytitle><menuentrydescrip/></menuentry><detailmenu><menuline>— The Detailed Node Listing —</menuline><menuline/><menuline>Converting to man pages</menuline><menuline/><menuentry idref="docbook2man"><menuentrytitle>docbook2man</menuentrytitle><menuentrydescrip>Convert DocBook to man pages</menuentrydescrip></menuentry><menuentry idref="db2x_manxml"><menuentrytitle><code>db2x_manxml</code></menuentrytitle><menuentrydescrip>Make man pages from Man-XML</menuentrydescrip></menuentry><menuline/><menuline>Converting to Texinfo</menuline><menuline/><menuentry idref="docbook2texi"><menuentrytitle>docbook2texi</menuentrytitle><menuentrydescrip>Convert DocBook to Texinfo</menuentrydescrip></menuentry><menuentry idref="db2x_texixml"><menuentrytitle><code>db2x_texixml</code></menuentrytitle><menuentrydescrip>Make Texinfo files from Texi-XML</menuentrydescrip></menuentry><menuline/><menuline>The XSLT stylesheets</menuline><menuline/><menuentry idref="db2x_xsltproc"><menuentrytitle><code>db2x_xsltproc</code></menuentrytitle><menuentrydescrip>XSLT processor invocation wrapper</menuentrydescrip></menuentry><menuentry idref="sgml2xml-isoent"><menuentrytitle><code>sgml2xml-isoent</code></menuentrytitle><menuentrydescrip>Convert SGML to XML with support for ISO
entities</menuentrydescrip></menuentry><menuline/><menuline>Character set conversion</menuline><menuline/><menuentry idref="utf8trans"><menuentrytitle><code>utf8trans</code></menuentrytitle><menuentrydescrip>Transliterate UTF-8 characters according to a table</menuentrydescrip></menuentry><menuline/><menuline>Package installation</menuline><menuline/><menuentry idref="install-procedure"><menuentrytitle>Installation</menuentrytitle><menuentrydescrip>Package install procedure</menuentrydescrip></menuentry><menuentry idref="dependencies"><menuentrytitle>Dependencies on other software</menuentrytitle><menuentrydescrip>Other software packages that docbook2X needs</menuentrydescrip></menuentry><menuline/></detailmenu></menu><node id="quickstart" previousid="docbook2X" nextid="manpages" upid="docbook2X"/><chapter>Quick start</chapter><indexterm class="cp">example usage</indexterm><indexterm class="cp">converting to man pages</indexterm><indexterm class="cp">converting to Texinfo</indexterm><para>
To convert to man pages, you run the command <code>docbook2man</code> (<pxref idref="docbook2man"/>).  For example,

<example>$ docbook2man --solinks manpages.xml
</example><para>
The man pages will be output to your current directory.
</para><para>
The <code>--solinks</code> options tells <code>docbook2man</code> to create man page
links.  You may want to omit this option when developing documentation
so that your working directory does not explode with many stub man pages.
(If you don’t know what this means, you can read about it in detail in <code>db2x_manxml</code>,
 or just ignore the previous two sentences and always specify this option.)
</para>
</para><para>
To convert to Texinfo, you run the command <code>docbook2texi</code> (<pxref idref="docbook2texi"/>).  For example,

<example>$ docbook2texi tdg.xml
</example><para>
One (or more) Texinfo files will be output to your current directory.
</para>
</para><para>
The rest of this manual describes in detail all the other options
and how to customize docbook2X’s output.
</para><node id="manpages" previousid="quickstart" nextid="texinfo" upid="docbook2X"/><chapter>Converting to man pages</chapter><indexterm class="cp">man pages</indexterm><indexterm class="cp">converting to man pages</indexterm><indexterm class="cp">XSLT stylesheets</indexterm><indexterm class="cp">Man-XML</indexterm><para>
DocBook documents are converted to man pages in two steps:

<enumerate><listitem><para>
The DocBook source is converted by a XSLT stylesheet into an 
intermediate XML format, Man-XML.</para><para>
Man-XML is simpler than DocBook and closer to the man page format;
it is intended to make the stylesheets’ job easier.
</para><para>
The stylesheet for this purpose is in
<file>xslt/man/docbook.xsl</file>.
For portability, it should always be referred to
by the following URI:
<example>http://docbook2x.sourceforge.net/latest/xslt/man/docbook.xsl
</example>
</para><para>
Run this stylesheet with <ref idref="db2x_xsltproc"><code>db2x_xsltproc</code></ref>.
</para><indexterm class="cp">customizing</indexterm><para><strong>Customizing. </strong> 
You can also customize the output by
creating your own XSLT stylesheet —
changing parameters or adding new templates —
and importing <file>xslt/man/docbook.xsl</file>.
</para></listitem><listitem><para>
Man-XML is converted to the actual man pages by <ref idref="db2x_manxml"><code>db2x_manxml</code></ref>.
</para></listitem></enumerate>
</para><para>
The <code>docbook2man</code> (<pxref idref="docbook2man"/>) command does both steps automatically,
but if any problems occur, you can see the errors more clearly
if you do each step separately:

<example>$ db2x_xsltproc -s man mydoc.xml -o mydoc.mxml
$ db2x_manxml mydoc.mxml
</example>

</para><para>
Options to the conversion stylesheet are described in
<ref node="Top" file="docbook2man-xslt" printmanual="docbook2X Man-pages Stylesheets Reference">the man-pages stylesheets
reference</ref>.
</para><indexterm class="cp">pure XSLT</indexterm><para><strong>Pure XSLT conversion. </strong> 
An alternative to the <code>db2x_manxml</code> Perl script is the XSLT
stylesheet in 
<file>xslt/backend/db2x_manxml.xsl</file>.
This stylesheet performs a similar function
of converting Man-XML to actual man pages.
It is useful if you desire a pure XSLT
solution to man-page conversion.
Of course, the quality of the conversion using this stylesheet
will never be as good as the Perl <code>db2x_manxml</code>,
and it runs slower.  
In particular, the pure XSLT version
currently does not support tables in man pages,
but its Perl counterpart does.

</para><menu><menuentry idref="docbook2man"><menuentrytitle>docbook2man</menuentrytitle><menuentrydescrip>Convert DocBook to man pages</menuentrydescrip></menuentry><menuentry idref="db2x_manxml"><menuentrytitle><code>db2x_manxml</code></menuentrytitle><menuentrydescrip>Make man pages from Man-XML</menuentrydescrip></menuentry></menu><node id="docbook2man" nextid="db2x_manxml" upid="manpages"/><section>docbook2man</section><indexterm class="cp">man pages</indexterm><indexterm class="cp">converting to man pages</indexterm><indexterm class="cp">wrapper script</indexterm><indexterm class="cp"><code>docbook2man</code></indexterm><subheading>Name</subheading><para><code>docbook2man</code> — Convert DocBook to man pages</para><subheading>Synopsis</subheading><quotation><para><t>docbook2man [options]  xml-document </t></para></quotation><subheading>Description</subheading><para>
<code>docbook2man</code> converts the given DocBook XML document into man pages.
By default, the man pages will be output to the current directory.
</para><para>
<indexterm class="cp"><code>refentry</code></indexterm>
Only the <code>refentry</code> content
in the DocBook document is converted.
(To convert content outside of a <code>refentry</code>,
stylesheet customization is required.  See the docbook2X
package for details.)
</para><para>
The <code>docbook2man</code> command is a wrapper script
for a two-step conversion process.

</para><subheading>Options</subheading><para>
The available options are essentially the union of the options
from <ref idref="db2x_xsltproc"><code>db2x_xsltproc</code></ref> and <ref idref="db2x_manxml"><code>db2x_manxml</code></ref>.
</para><para>
Some commonly-used options are listed below:
</para><varlist><varlistentry><term><code>--encoding=<var>encoding</var></code></term><listitem><para>
        Sets the character encoding of the output.
      </para></listitem></varlistentry><varlistentry><term><code>--string-param <var>parameter</var>=<var>value</var></code></term><listitem><para>
        Sets a stylesheet parameter (options that affect how the output looks).
        See “Stylesheet parameters” below for the parameters that
        can be set.
      </para></listitem></varlistentry><varlistentry><term><code>--sgml</code></term><listitem><para>
        Accept an SGML source document as input instead of XML.
      </para></listitem></varlistentry><varlistentry><term><code>--solinks</code></term><listitem><para>
        Make stub pages for alternate names for an output man page.
      </para></listitem></varlistentry></varlist><subsubheading>Stylesheet parameters</subsubheading><indexterm class="cp">stylesheet parameters</indexterm><varlist><varlistentry><term><code>uppercase-headings</code></term><listitem><para><strong>Brief. </strong> Make headings uppercase?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>
Headings in man page content should be or should not be uppercased.
</para></listitem></varlistentry><varlistentry><term><code>manvolnum-cite-numeral-only</code></term><listitem><para><strong>Brief. </strong> Man page section citation should use only the number</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>
When citing other man pages, the man-page section is either given as is,
or has the letters stripped from it, citing only the number of the
section (e.g. section <samp>3x</samp> becomes
<samp>3</samp>).  This option specifies which style. 
</para></listitem></varlistentry><varlistentry><term><code>quotes-on-literals</code></term><listitem><para><strong>Brief. </strong> Display quotes on <code>literal</code>
elements?</para><para><strong>Default setting. </strong> <samp>0</samp> (boolean false)</para><para>
If true, render <code>literal</code> elements
with quotes around them.
</para></listitem></varlistentry><varlistentry><term><code>show-comments</code></term><listitem><para><strong>Brief. </strong> Display <code>comment</code> elements?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>If true, comments will be displayed, otherwise they are suppressed.
Comments here refers to the <code>comment</code> element,
which will be renamed <code>remark</code> in DocBook V4.0,
not XML comments (&lt;-- like this --&gt;) which are unavailable.
</para></listitem></varlistentry><varlistentry><term><code>function-parens</code></term><listitem><para><strong>Brief. </strong> Generate parentheses after a function?</para><para><strong>Default setting. </strong> <samp>0</samp> (boolean false)</para><para>If true, the formatting of
a <code>&lt;function&gt;</code> element will include
generated parenthesis.
</para></listitem></varlistentry><varlistentry><term><code>xref-on-link</code></term><listitem><para><strong>Brief. </strong> Should <code>link</code> generate a
cross-reference?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>
Man pages cannot render the hypertext links created by <code>link</code>.  If this option is set, then the
stylesheet renders a cross reference to the target of the link.
(This may reduce clutter).  Otherwise, only the content of the <code>link</code> is rendered and the actual link itself is
ignored.
</para></listitem></varlistentry><varlistentry><term><code>header-3</code></term><listitem><para><strong>Brief. </strong> Third header text</para><para><strong>Default setting. </strong> (blank)</para><para>
Specifies the text of the third header of a man page,
typically the date for the man page.  If empty, the <code>date</code> content for the <code>refentry</code> is used.
</para></listitem></varlistentry><varlistentry><term><code>header-4</code></term><listitem><para><strong>Brief. </strong> Fourth header text</para><para><strong>Default setting. </strong> (blank)</para><para>
Specifies the text of the fourth header of a man page.
If empty, the <code>refmiscinfo</code> content for
the <code>refentry</code> is used.
</para></listitem></varlistentry><varlistentry><term><code>header-5</code></term><listitem><para><strong>Brief. </strong> Fifth header text</para><para><strong>Default setting. </strong> (blank)</para><para>
Specifies the text of the fifth header of a man page.
If empty, the ‘manual name’, that is, the title of the
<code>book</code> or <code>reference</code> container is used.
</para></listitem></varlistentry><varlistentry><term><code>default-manpage-section</code></term><listitem><para><strong>Brief. </strong> Default man page section</para><para><strong>Default setting. </strong> <samp>1</samp></para><para>
The source document usually indicates the sections that each man page
should belong to (with <code>manvolnum</code> in
<code>refmeta</code>).  In case the source
document does not indicate man-page sections, this option specifies the
default.
</para></listitem></varlistentry><varlistentry><term><code>custom-localization-file</code></term><listitem><para><strong>Brief. </strong> URI of XML document containing custom localization data</para><para><strong>Default setting. </strong> (blank)</para><para>
This parameter specifies the URI of a XML document
that describes text translations (and other locale-specific information)
that is needed by the stylesheet to process the DocBook document.
</para><para>
The text translations pointed to by this parameter always
override the default text translations 
(from the internal parameter <code>localization-file</code>).
If a particular translation is not present here,
the corresponding default translation 
is used as a fallback.
</para><para>
This parameter is primarily for changing certain
punctuation characters used in formatting the source document.
The settings for punctuation characters are often specific
to the source document, but can also be dependent on the locale.
</para><para>
To not use custom text translations, leave this parameter 
as the empty string.
</para></listitem></varlistentry><varlistentry><term><code>custom-l10n-data</code></term><listitem><para><strong>Brief. </strong> XML document containing custom localization data</para><para><strong>Default setting. </strong> <samp>document($custom-localization-file)</samp></para><para>
This parameter specifies the XML document
that describes text translations (and other locale-specific information)
that is needed by the stylesheet to process the DocBook document.
</para><para>
This parameter is internal to the stylesheet.
To point to an external XML document with a URI or a file name, 
you should use the <code>custom-localization-file</code>
parameter instead.
</para><para>
However, inside a custom stylesheet 
(<emph>not on the command-line</emph>)
this paramter can be set to the XPath expression
<samp>document('')</samp>,
which will cause the custom translations 
directly embedded inside the custom stylesheet to be read.
</para></listitem></varlistentry><varlistentry><term><code>author-othername-in-middle</code></term><listitem><para><strong>Brief. </strong> Is <code>othername</code> in <code>author</code> a
middle name?</para><para><strong>Default setting. </strong> <samp>1</samp></para><para>If true, the <code>othername</code> of an <code>author</code>
appears between the <code>firstname</code> and
<code>surname</code>.  Otherwise, <code>othername</code>
is suppressed.
</para></listitem></varlistentry></varlist><subheading>Examples</subheading><indexterm class="cp">example usage</indexterm><example>$ docbook2man --solinks manpages.xml
$ docbook2man --solinks --encoding=utf-8//TRANSLIT manpages.xml
$ docbook2man --string-param header-4="Free Recode 3.6" document.xml
</example><subheading>Limitations</subheading><itemize markchar="&#x2022;"><listitem><para>
      Internally there is one long pipeline of programs which your 
      document goes through.  If any segment of the pipeline fails
      (even trivially, like from mistyped program options), 
      the resulting errors can be difficult to decipher —
      in this case, try running the components of docbook2X
      separately.
    </para></listitem></itemize><node id="db2x_manxml" previousid="docbook2man" upid="manpages"/><section><code>db2x_manxml</code></section><indexterm class="cp">man pages</indexterm><indexterm class="cp">converting to man pages</indexterm><indexterm class="cp">Man-XML</indexterm><indexterm class="cp">stub pages</indexterm><indexterm class="cp">symbolic links</indexterm><indexterm class="cp">encoding</indexterm><indexterm class="cp">output directory</indexterm><indexterm class="cp"><code>db2x_manxml</code></indexterm><subheading>Name</subheading><para><code>db2x_manxml</code> — Make man pages from Man-XML</para><subheading>Synopsis</subheading><quotation><para><t>db2x_manxml [options] [xml-document]</t></para></quotation><subheading>Description</subheading><para>
<code>db2x_manxml</code> converts a Man-XML document into one or 
more man pages.  They are written in the current directory.
</para><para>
If <var>xml-document</var> is not given, then the document
to convert is read from standard input.  
</para><subheading>Options</subheading><varlist><varlistentry><term><code>--encoding=<var>encoding</var></code></term><listitem><para>
Select the character encoding used for the output files.
The available encodings are those of 
iconv(1). 
The default encoding is <samp>us-ascii</samp>.  
</para><para>
The XML source may contain characters that are not representable in the encoding that
you select;  in this case the program will bomb out during processing, and you should 
choose another encoding.
(This is guaranteed not to happen with any Unicode encoding such as 
UTF-8, but unfortunately not everyone is able to 
process Unicode texts.)
</para><para>
If you are using GNU’s version of 
iconv(1), you can affix 
<samp>//TRANSLIT</samp> to the end of the encoding name
to attempt transliterations of any unconvertible characters in the output.
Beware, however, that the really inconvertible characters will be turned
into another of those damned question marks.  (Aren’t you sick of this?)
</para><para>
The suffix <samp>//TRANSLIT</samp> applied
to a Unicode encoding — in particular, <samp>utf-8//TRANSLIT</samp> —
means that the output files are to remain in Unicode,
but markup-level character translations using <code>utf8trans</code> 
are still to be done.  So in most cases, an English-language
document, converted using 
<code>--encoding=<samp>utf-8//TRANSLIT</samp></code>
will actually end up as a US-ASCII document,
but any untranslatable characters 
will remain as UTF-8 without any warning whatsoever.
(Note: strictly speaking this is not “transliteration”.)
This method of conversion is a compromise over strict
<code>--encoding=<samp>us-ascii</samp></code>
processing, which aborts if any untranslatable characters are 
encountered.
</para><para>
Note that man pages and Texinfo documents 
in non-ASCII encodings (including UTF-8)
may not be portable to older (non-internationalized) systems,
which is why the default value for this option is 
<samp>us-ascii</samp>.
</para><para>
To suppress any automatic character mapping or encoding conversion
whatsoever, pass the option 
<code>--encoding=<samp>utf-8</samp></code>.
</para></listitem></varlistentry><varlistentry><term><code>--list-files</code></term><listitem><para>
Write a list of all the output files to standard output,
in addition to normal processing.
</para></listitem></varlistentry><varlistentry><term><code>--output-dir=<var>dir</var></code></term><listitem><para>
Specify the directory where the output files are placed.
The default is the current working directory.
</para><para>
This option is ignored if the output is to be written
to standard output (triggered by the 
option <code>--to-stdout</code>).
</para></listitem></varlistentry><varlistentry><term><code>--to-stdout</code></term><listitem><para>
Write the output to standard output instead of to individual files.
</para><para>
If this option is used even when there are supposed to be multiple
output documents, then everything is concatenated to standard output.
But beware that most other programs will not accept this concatenated
output.
</para><para>
This option is incompatible with <code>--list-files</code>,
obviously.
</para></listitem></varlistentry><varlistentry><term><code>--help</code></term><listitem><para>Show brief usage information and exit.</para></listitem></varlistentry><varlistentry><term><code>--version</code></term><listitem><para>Show version and exit.</para></listitem></varlistentry></varlist><para>Some man pages may be referenced under two or more
names, instead of just one.  For example, 
strcpy(3)
and
strncpy(3)
often point to the same man page which describes the two functions together.
Choose one of the following options to select
how such man pages are to be generated:
</para><varlist><varlistentry><term><code>--symlinks</code></term><listitem><para>For each of all the alternate names for a man page,
erect symbolic links to the file that contains the real man page content.
</para></listitem></varlistentry><varlistentry><term><code>--solinks</code></term><listitem><para>Generate stub pages (using <samp>.so</samp> roff requests)
for the alternate names, pointing them to the real man page content.</para></listitem></varlistentry><varlistentry><term><code>--no-links</code></term><listitem><para>Do not make any alternative names available.
The man page can only be referenced under its principal name.
</para></listitem></varlistentry></varlist><para>
This program uses certain other programs for its operation.
If they are not in their default installed locations, then use
the following options to set their location:

<varlist><varlistentry><term><code>--utf8trans-program=<var>path</var></code></term><term><code>--utf8trans-map=<var>charmap</var></code></term><listitem><para>Use the character map <var>charmap</var>
with the <ref idref="utf8trans"><code>utf8trans</code></ref> program, included with docbook2X, found
under <var>path</var>.</para></listitem></varlistentry><varlistentry><term><code>--iconv-program=<var>path</var></code></term><listitem><para>The location of the 
iconv(1) program, used for encoding
conversions.</para></listitem></varlistentry></varlist></para><subheading>Notes</subheading><indexterm class="cp"><code>groff</code></indexterm><indexterm class="cp">compatibility</indexterm><para>
The man pages produced should be compatible
with most troff implementations and other tools
that process man pages.
Some backwards-compatible 
groff(1) extensions
are used to make the output look nicer.
</para><subheading>See Also</subheading><para>
The input to <code>db2x_manxml</code> is defined by the XML DTD
present at <file>dtd/Man-XML</file> in the docbook2X
distribution.
</para><node id="texinfo" previousid="manpages" nextid="xsltproc" upid="docbook2X"/><chapter>Converting to Texinfo</chapter><indexterm class="cp">Texinfo</indexterm><indexterm class="cp">converting to Texinfo</indexterm><indexterm class="cp">XSLT stylesheets</indexterm><indexterm class="cp">Texi-XML</indexterm><para>
DocBook documents are converted to Texinfo in two steps:

<enumerate><listitem><para>
The DocBook source is converted by a XSLT stylesheet into an intermediate
XML format, Texi-XML.</para><para>
Texi-XML is simpler than DocBook and closer to the Texinfo format;
it is intended to make the stylesheets’ job easier.
</para><para>
The stylesheet for this purpose is in
<file>xslt/texi/docbook.xsl</file>.
For portability, it should always be referred to
by the following URI:
<example>http://docbook2x.sourceforge.net/latest/xslt/texi/docbook.xsl
</example>
</para><para>
Run this stylesheet with <ref idref="db2x_xsltproc"><code>db2x_xsltproc</code></ref>.
</para><indexterm class="cp">customizing</indexterm><para><strong>Customizing. </strong> 
You can also customize the output by
creating your own XSLT stylesheet —
changing parameters or adding new templates —
and importing <file>xslt/texi/docbook.xsl</file>.
</para></listitem><listitem><para>
Texi-XML is converted to the actual Texinfo files by <ref idref="db2x_texixml"><code>db2x_texixml</code></ref>.
</para></listitem></enumerate>

</para><para>
The <code>docbook2texi</code> (<pxref idref="docbook2texi"/>) command does both steps automatically,
but if any problems occur, you can see the errors more clearly
if you do each step separately:

<example>$ db2x_xsltproc -s texi mydoc.xml -o mydoc.txml
$ db2x_texixml mydoc.txml
</example>

</para><para>
Options to the conversion stylesheet are described
in <ref node="Top" file="docbook2texi-xslt" printmanual="docbook2X Texinfo Stylesheets Reference">the Texinfo stylesheets
reference</ref>.
</para><menu><menuentry idref="docbook2texi"><menuentrytitle>docbook2texi</menuentrytitle><menuentrydescrip>Convert DocBook to Texinfo</menuentrydescrip></menuentry><menuentry idref="db2x_texixml"><menuentrytitle><code>db2x_texixml</code></menuentrytitle><menuentrydescrip>Make Texinfo files from Texi-XML</menuentrydescrip></menuentry></menu><node id="docbook2texi" nextid="db2x_texixml" upid="texinfo"/><section>docbook2texi</section><indexterm class="cp">Texinfo</indexterm><indexterm class="cp">converting to Texinfo</indexterm><indexterm class="cp">wrapper script</indexterm><indexterm class="cp"><code>docbook2texi</code></indexterm><subheading>Name</subheading><para><code>docbook2texi</code> — Convert DocBook to Texinfo</para><subheading>Synopsis</subheading><quotation><para><t>docbook2texi [options]  xml-document </t></para></quotation><subheading>Description</subheading><para>
<code>docbook2texi</code> converts the given 
DocBook XML document into one or more Texinfo documents.
By default, these Texinfo documents will be output to the current
directory.
</para><para>
The <code>docbook2texi</code> command is a wrapper script
for a two-step conversion process.

</para><subheading>Options</subheading><para>
The available options are essentially the union of the options
for <ref idref="db2x_xsltproc"><code>db2x_xsltproc</code></ref> and <ref idref="db2x_texixml"><code>db2x_texixml</code></ref>.
</para><para>
Some commonly-used options are listed below:
</para><varlist><varlistentry><term><code>--encoding=<var>encoding</var></code></term><listitem><para>
        Sets the character encoding of the output.
      </para></listitem></varlistentry><varlistentry><term><code>--string-param <var>parameter</var>=<var>value</var></code></term><listitem><para>
        Sets a stylesheet parameter (options that affect how the output looks).
        See “Stylesheet parameters” below for the parameters that
        can be set.
      </para></listitem></varlistentry><varlistentry><term><code>--sgml</code></term><listitem><para>
        Accept an SGML source document as input instead of XML.
      </para></listitem></varlistentry></varlist><subsubheading>Stylesheet parameters</subsubheading><indexterm class="cp">stylesheet parameters</indexterm><varlist><varlistentry><term><code>captions-display-as-headings</code></term><listitem><para><strong>Brief. </strong> Use heading markup for minor captions?</para><para><strong>Default setting. </strong> <samp>0</samp> (boolean false)</para><para>If true, <code>title</code>
content in some (formal) objects are rendered with the Texinfo
<code>@<var>heading</var></code> commands.
</para><para>
If false, captions are rendered as an emphasized paragraph.
</para></listitem></varlistentry><varlistentry><term><code>links-use-pxref</code></term><listitem><para><strong>Brief. </strong> Translate <code>link</code> using
<code>@pxref</code></para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>
If true, <code>link</code> is translated
with the hypertext followed by the cross reference in parentheses.
</para><para>
Otherwise, the hypertext content serves as the cross-reference name
marked up using <code>@ref</code>.  Typically info displays this
contruct badly.
</para></listitem></varlistentry><varlistentry><term><code>explicit-node-names</code></term><listitem><para><strong>Brief. </strong> Insist on manually constructed Texinfo node
names</para><para><strong>Default setting. </strong> <samp>0</samp> (boolean false)</para><para>
Elements in the source document can influence the Texinfo node name
generation specifying either a <code>xreflabel</code>, or for the sectioning elements,
a <code>title</code> with <code>role='texinfo-node'</code> in the 
<code><var>*</var>info</code> container.
</para><para>
However, for the majority of source documents, explicit Texinfo node
names are not available, and the stylesheet tries to generate a
reasonable one instead, e.g. from the normal title of an element.  
The generated name may not be optimal.  If this option is set and the
stylesheet needs to generate a name, a warning is emitted and 
<code>generate-id</code> is always used for the name.
</para><para>
When the hashtable extension is not available, the stylesheet cannot
check for node name collisions, and in this case, setting this option
and using explicit node names are recommended.  
</para><para>
This option is not set (i.e. false) by default.
</para><quotation><para><strong>Note</strong></para><para>The absolute fallback for generating node names is using the XSLT
function <code>generate-id</code>, and the stylesheet always
emits a warning in this case regardless of the setting of
<code>explicit-node-names</code>.</para></quotation></listitem></varlistentry><varlistentry><term><code>show-comments</code></term><listitem><para><strong>Brief. </strong> Display <code>comment</code> elements?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>If true, comments will be displayed, otherwise they are suppressed.
Comments here refers to the <code>comment</code> element,
which will be renamed <code>remark</code> in DocBook V4.0,
not XML comments (&lt;-- like this --&gt;) which are unavailable.
</para></listitem></varlistentry><varlistentry><term><code>funcsynopsis-decoration</code></term><listitem><para><strong>Brief. </strong> Decorate elements of a FuncSynopsis?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>If true, elements of the FuncSynopsis will be decorated (e.g. bold or
italic).  The decoration is controlled by functions that can be redefined
in a customization layer.
</para></listitem></varlistentry><varlistentry><term><code>function-parens</code></term><listitem><para><strong>Brief. </strong> Generate parentheses after a function?</para><para><strong>Default setting. </strong> <samp>0</samp> (boolean false)</para><para>If true, the formatting of
a <code>&lt;function&gt;</code> element will include
generated parenthesis.
</para></listitem></varlistentry><varlistentry><term><code>refentry-display-name</code></term><listitem><para><strong>Brief. </strong> Output NAME header before 'RefName'(s)?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>If true, a "NAME" section title is output before the list
of 'RefName's.
</para></listitem></varlistentry><varlistentry><term><code>manvolnum-in-xref</code></term><listitem><para><strong>Brief. </strong> Output <code>manvolnum</code> as part of
<code>refentry</code> cross-reference?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>if true, the <code>manvolnum</code> is used when cross-referencing
<code>refentry</code>s, either with <code>xref</code>
or <code>citerefentry</code>.
</para></listitem></varlistentry><varlistentry><term><code>prefer-textobjects</code></term><listitem><para><strong>Brief. </strong> Prefer <code>textobject</code>
over <code>imageobject</code>?
</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>
If true, the 
<code>textobject</code>
in a <code>mediaobject</code>
is preferred over any
<code>imageobject</code>.
</para><para>
(Of course, for output formats other than Texinfo, you usually
want to prefer the <code>imageobject</code>,
but Info is a text-only format.)
</para><para>
In addition to the values true and false, this parameter
may be set to <samp>2</samp> to indicate that
both the text and the images should be output.
You may want to do this because some Texinfo viewers
can read images.  Note that the Texinfo <code>@image</code>
command has its own mechanism for switching between text
and image output — but we do not use this here.
</para><para>
The default is true.
</para></listitem></varlistentry><varlistentry><term><code>semantic-decorations</code></term><listitem><para><strong>Brief. </strong> Use Texinfo semantic inline markup?</para><para><strong>Default setting. </strong> <samp>1</samp> (boolean true)</para><para>
If true, the semantic inline markup of DocBook is translated into
(the closest) Texinfo equivalent.  This is the default.
</para><para>
However, because the Info format is limited to plain text,
the semantic inline markup is often distinguished by using 
explicit quotes, which may not look good.  
You can set this option to false to suppress these.
(For finer control over the inline formatting, you can
use your own stylesheet.)
</para></listitem></varlistentry><varlistentry><term><code>custom-localization-file</code></term><listitem><para><strong>Brief. </strong> URI of XML document containing custom localization data</para><para><strong>Default setting. </strong> (blank)</para><para>
This parameter specifies the URI of a XML document
that describes text translations (and other locale-specific information)
that is needed by the stylesheet to process the DocBook document.
</para><para>
The text translations pointed to by this parameter always
override the default text translations 
(from the internal parameter <code>localization-file</code>).
If a particular translation is not present here,
the corresponding default translation 
is used as a fallback.
</para><para>
This parameter is primarily for changing certain
punctuation characters used in formatting the source document.
The settings for punctuation characters are often specific
to the source document, but can also be dependent on the locale.
</para><para>
To not use custom text translations, leave this parameter 
as the empty string.
</para></listitem></varlistentry><varlistentry><term><code>custom-l10n-data</code></term><listitem><para><strong>Brief. </strong> XML document containing custom localization data</para><para><strong>Default setting. </strong> <samp>document($custom-localization-file)</samp></para><para>
This parameter specifies the XML document
that describes text translations (and other locale-specific information)
that is needed by the stylesheet to process the DocBook document.
</para><para>
This parameter is internal to the stylesheet.
To point to an external XML document with a URI or a file name, 
you should use the <code>custom-localization-file</code>
parameter instead.
</para><para>
However, inside a custom stylesheet 
(<emph>not on the command-line</emph>)
this paramter can be set to the XPath expression
<samp>document('')</samp>,
which will cause the custom translations 
directly embedded inside the custom stylesheet to be read.
</para></listitem></varlistentry><varlistentry><term><code>author-othername-in-middle</code></term><listitem><para><strong>Brief. </strong> Is <code>othername</code> in <code>author</code> a
middle name?</para><para><strong>Default setting. </strong> <samp>1</samp></para><para>If true, the <code>othername</code> of an <code>author</code>
appears between the <code>firstname</code> and
<code>surname</code>.  Otherwise, <code>othername</code>
is suppressed.
</para></listitem></varlistentry><varlistentry><term><code>output-file</code></term><listitem><para><strong>Brief. </strong> Name of the Info file</para><para><strong>Default setting. </strong> (blank)</para><indexterm class="cp">Texinfo metadata</indexterm><para>This parameter specifies the name of the final Info file,
overriding the setting in the document itself and the automatic
selection in the stylesheet.  If the document is a <code>set</code>, this parameter has no effect. </para><quotation><para><strong>Important</strong></para><para>
Do <emph>not</emph> include the <samp>.info</samp>
extension in the name.
</para></quotation><para>
(Note that this parameter has nothing to do with the name of
the <emph>Texi-XML output</emph> by the XSLT processor you 
are running this stylesheet from.)
</para></listitem></varlistentry><varlistentry><term><code>directory-category</code></term><listitem><para><strong>Brief. </strong> The categorization of the document in the Info directory</para><para><strong>Default setting. </strong> (blank)</para><indexterm class="cp">Texinfo metadata</indexterm><para>
This is set to the category that the document
should go under in the Info directory of installed Info files.
For example, <samp>General Commands</samp>.
</para><quotation><para><strong>Note</strong></para><para>
Categories may also be set directly in the source document.
But if this parameter is not empty, then it always overrides the 
setting in the source document.
</para></quotation></listitem></varlistentry><varlistentry><term><code>directory-description</code></term><listitem><para><strong>Brief. </strong> The description of the document in the Info directory</para><para><strong>Default setting. </strong> (blank)</para><indexterm class="cp">Texinfo metadata</indexterm><para>
This is a short description of the document that appears in
the Info directory of installed Info files.
For example, <samp>An Interactive Plotting Program.</samp>
</para><quotation><para><strong>Note</strong></para><para>
Menu descriptions may also be set directly in the source document.
But if this parameter is not empty, then it always overrides the 
setting in the source document.
</para></quotation></listitem></varlistentry><varlistentry><term><code>index-category</code></term><listitem><para><strong>Brief. </strong> The Texinfo index to use</para><para><strong>Default setting. </strong> <samp>cp</samp></para><para>The Texinfo index for <code>indexterm</code>
and <code>index</code> is specified using the
<code>role</code> attribute.  If the above
elements do not have a <code>role</code>, then
the default specified by this parameter is used.
</para><para>
The predefined indices are:

<varlist><varlistentry><term><samp>c</samp></term><term><samp>cp</samp></term><listitem><para>Concept index</para></listitem></varlistentry><varlistentry><term><samp>f</samp></term><term><samp>fn</samp></term><listitem><para>Function index</para></listitem></varlistentry><varlistentry><term><samp>v</samp></term><term><samp>vr</samp></term><listitem><para>Variable index</para></listitem></varlistentry><varlistentry><term><samp>k</samp></term><term><samp>ky</samp></term><listitem><para>Keystroke index</para></listitem></varlistentry><varlistentry><term><samp>p</samp></term><term><samp>pg</samp></term><listitem><para>Program index</para></listitem></varlistentry><varlistentry><term><samp>d</samp></term><term><samp>tp</samp></term><listitem><para>Data type index</para></listitem></varlistentry></varlist>

User-defined indices are not yet supported.
</para></listitem></varlistentry><varlistentry><term><code>qanda-defaultlabel</code></term><listitem><para><strong>Brief. </strong> Sets the default for defaultlabel on QandASet.</para><para><strong>Default setting. </strong> <samp/></para><para>If no defaultlabel attribute is specified on a QandASet, this
value is used. It must be one of the legal values for the defaultlabel
attribute.
</para></listitem></varlistentry><varlistentry><term><code>qandaset-generate-toc</code></term><listitem><para><strong>Brief. </strong> Is a Table of Contents created for QandASets?</para><para><strong>Default setting. </strong> <samp/></para><para>If true, a ToC is constructed for QandASets.
</para></listitem></varlistentry></varlist><subheading>Examples</subheading><indexterm class="cp">example usage</indexterm><example>$ docbook2texi tdg.xml
$ docbook2texi --encoding=utf-8//TRANSLIT tdg.xml
$ docbook2texi --string-param semantic-decorations=0 tdg.xml
</example><subheading>Limitations</subheading><itemize markchar="&#x2022;"><listitem><para>
      Internally there is one long pipeline of programs which your 
      document goes through.  If any segment of the pipeline fails
      (even trivially, like from mistyped program options), 
      the resulting errors can be difficult to decipher —
      in this case, try running the components of docbook2X
      separately.
    </para></listitem></itemize><node id="db2x_texixml" previousid="docbook2texi" upid="texinfo"/><section><code>db2x_texixml</code></section><indexterm class="cp">Texinfo</indexterm><indexterm class="cp">converting to Texinfo</indexterm><indexterm class="cp">Texi-XML</indexterm><indexterm class="cp">encoding</indexterm><indexterm class="cp">output directory</indexterm><indexterm class="cp"><code>makeinfo</code></indexterm><subheading>Name</subheading><para><code>db2x_texixml</code> — Make Texinfo files from Texi-XML</para><subheading>Synopsis</subheading><quotation><para><t>db2x_texixml [options]… [xml-document]</t></para></quotation><subheading>Description</subheading><para>
<code>db2x_texixml</code> converts a Texi-XML document into one or 
more Texinfo documents.
</para><para>
If <var>xml-document</var> is not given, then the document
to convert comes from standard input.  
</para><para>
The filenames of the Texinfo documents are determined by markup in the
Texi-XML source.  (If the filenames are not specified in the markup,
then <code>db2x_texixml</code> attempts to deduce them from the name of the input
file.  However, the Texi-XML source should specify the filename, because
it does not work when there are multiple output files or when the
Texi-XML source comes from standard input.)
</para><subheading>Options</subheading><varlist><varlistentry><term><code>--encoding=<var>encoding</var></code></term><listitem><para>
Select the character encoding used for the output files.
The available encodings are those of 
iconv(1). 
The default encoding is <samp>us-ascii</samp>.  
</para><para>
The XML source may contain characters that are not representable in the encoding that
you select;  in this case the program will bomb out during processing, and you should 
choose another encoding.
(This is guaranteed not to happen with any Unicode encoding such as 
UTF-8, but unfortunately not everyone is able to 
process Unicode texts.)
</para><para>
If you are using GNU’s version of 
iconv(1), you can affix 
<samp>//TRANSLIT</samp> to the end of the encoding name
to attempt transliterations of any unconvertible characters in the output.
Beware, however, that the really inconvertible characters will be turned
into another of those damned question marks.  (Aren’t you sick of this?)
</para><para>
The suffix <samp>//TRANSLIT</samp> applied
to a Unicode encoding — in particular, <samp>utf-8//TRANSLIT</samp> —
means that the output files are to remain in Unicode,
but markup-level character translations using <code>utf8trans</code> 
are still to be done.  So in most cases, an English-language
document, converted using 
<code>--encoding=<samp>utf-8//TRANSLIT</samp></code>
will actually end up as a US-ASCII document,
but any untranslatable characters 
will remain as UTF-8 without any warning whatsoever.
(Note: strictly speaking this is not “transliteration”.)
This method of conversion is a compromise over strict
<code>--encoding=<samp>us-ascii</samp></code>
processing, which aborts if any untranslatable characters are 
encountered.
</para><para>
Note that man pages and Texinfo documents 
in non-ASCII encodings (including UTF-8)
may not be portable to older (non-internationalized) systems,
which is why the default value for this option is 
<samp>us-ascii</samp>.
</para><para>
To suppress any automatic character mapping or encoding conversion
whatsoever, pass the option 
<code>--encoding=<samp>utf-8</samp></code>.
</para></listitem></varlistentry><varlistentry><term><code>--list-files</code></term><listitem><para>
Write a list of all the output files to standard output,
in addition to normal processing.
</para></listitem></varlistentry><varlistentry><term><code>--output-dir=<var>dir</var></code></term><listitem><para>
Specify the directory where the output files are placed.
The default is the current working directory.
</para><para>
This option is ignored if the output is to be written
to standard output (triggered by the 
option <code>--to-stdout</code>).
</para></listitem></varlistentry><varlistentry><term><code>--to-stdout</code></term><listitem><para>
Write the output to standard output instead of to individual files.
</para><para>
If this option is used even when there are supposed to be multiple
output documents, then everything is concatenated to standard output.
But beware that most other programs will not accept this concatenated
output.
</para><para>
This option is incompatible with <code>--list-files</code>,
obviously.
</para></listitem></varlistentry><varlistentry><term><code>--info</code></term><listitem><para>Pipe the Texinfo output to 
makeinfo(1),
            creating Info files directly instead of
            Texinfo files.</para></listitem></varlistentry><varlistentry><term><code>--plaintext</code></term><listitem><para>Pipe the Texinfo output to <code>makeinfo
            <code>--no-headers</code></code>, thereby creating
            plain text files.</para></listitem></varlistentry><varlistentry><term><code>--help</code></term><listitem><para>Show brief usage information and exit.</para></listitem></varlistentry><varlistentry><term><code>--version</code></term><listitem><para>Show version and exit.</para></listitem></varlistentry></varlist><para>
This program uses certain other programs for its operation.
If they are not in their default installed locations, then use
the following options to set their location:

<varlist><varlistentry><term><code>--utf8trans-program=<var>path</var></code></term><term><code>--utf8trans-map=<var>charmap</var></code></term><listitem><para>Use the character map <var>charmap</var>
with the <ref idref="utf8trans"><code>utf8trans</code></ref> program, included with docbook2X, found
under <var>path</var>.</para></listitem></varlistentry><varlistentry><term><code>--iconv-program=<var>path</var></code></term><listitem><para>The location of the 
iconv(1) program, used for encoding
conversions.</para></listitem></varlistentry></varlist></para><subheading>Notes</subheading><para><strong>Texinfo language compatibility. </strong> 
    <indexterm class="cp">compatibility</indexterm>
    The Texinfo files generated by <code>db2x_texixml</code> sometimes require
    Texinfo version 4.7 (the latest version) to work properly.
    In particular:
    
    <itemize markchar="&#x2022;"><listitem><para>   
        <code>db2x_texixml</code> relies on <code>makeinfo</code>
        to automatically add punctuation after a <code>@ref</code>
        if it it not already there.  Otherwise the hyperlink will 
        not work in the Info reader (although
        <code>makeinfo</code> will not emit any error).
      </para></listitem><listitem><para>
        The new <code>@comma{}</code> command is used for commas
        (<samp>,</samp>) occurring inside argument lists to 
        Texinfo commands, to disambiguate it from the comma used
        to separate different arguments.  The only alternative 
        otherwise would be to translate <samp>,</samp> to 
        <samp>.</samp>
        which is obviously undesirable (but earlier docbook2X versions
        did this).</para><para>If you cannot use version 4.7 of
        <code>makeinfo</code>, you can still use a
        <code>sed</code> script to perform manually the procedure 
        just outlined.</para></listitem></itemize>
  </para><para><strong>Relation of Texi-XML with the XML output format of <code>makeinfo</code>. </strong> 
    The Texi-XML format used by docbook2X is <emph>different</emph>
    and incompatible with the XML format generated by 
makeinfo(1)
    with its <code>--xml</code> option.
    This situation arose partly because the Texi-XML format
    of docbook2X was designed and implemented independently 
    before the appearance
    of <code>makeinfo</code>’s XML format.
    Also Texi-XML is very much geared towards being 
    <emph>machine-generated from other XML formats</emph>,
    while there seems to be no non-trivial applications
    of <code>makeinfo</code>’s XML format.
    So there is no reason at this point for docbook2X
    to adopt <code>makeinfo</code>’s XML format
    in lieu of Texi-XML.
  </para><subheading>Bugs</subheading><itemize markchar="&#x2022;"><listitem><para>
      Text wrapping in menus is utterly broken for non-ASCII text.
      It is probably also broken everywhere else in the output, but 
      that would be <code>makeinfo</code>’s fault.
    </para></listitem><listitem><para>
      <code>--list-files</code> might not work correctly
      with <code>--info</code>.  Specifically, when the output
      Info file get too big, <code>makeinfo</code> will decide
      to split it into parts named 
      <file><var>abc</var>.info-1</file>,
      <file><var>abc</var>.info-2</file>,
      <file><var>abc</var>.info-3</file>, etc.
      <code>db2x_texixml</code> does not know exactly how many of these files
      there are, though you can just do an <code>ls</code> 
      to find out.
    </para></listitem></itemize><subheading>See Also</subheading><para>
The input to <code>db2x_texixml</code> is defined by the XML DTD
present at <file>dtd/Texi-XML</file> in the docbook2X
distribution.
</para><node id="xsltproc" previousid="texinfo" nextid="charsets" upid="docbook2X"/><chapter>The XSLT stylesheets</chapter><indexterm class="cp">XSLT processor</indexterm><indexterm class="cp">libxslt</indexterm><indexterm class="cp">SAXON</indexterm><indexterm class="cp">catalog</indexterm><indexterm class="cp"><code>db2x_xsltproc</code></indexterm><para>
docbook2X uses a XSLT 1.0 processor to run its stylesheets.
docbook2X comes with a wrapper script,
<ref idref="db2x_xsltproc"><code>db2x_xsltproc</code></ref>, that invokes the XSLT processor, 
but you can invoke the XSLT processor in any other
way you wish.
</para><para>
The stylesheets are described in
<ref node="Top" file="docbook2man-xslt" printmanual="docbook2X Man-pages Stylesheets Reference">the man-pages stylesheets
reference</ref>
and <ref node="Top" file="docbook2texi-xslt" printmanual="docbook2X Texinfo Stylesheets Reference">the Texinfo stylesheets
reference</ref>.
</para><indexterm class="cp">pure XSLT</indexterm><indexterm class="cp"><code>xsltproc</code></indexterm><para>
Pure-XSLT implementations of <code>db2x_manxml</code>
and <code>db2x_texixml</code> also exist.  
They may be used as follows (assuming libxslt as the XSLT processor).

<anchor id="xsltproc.db2x_manxml"/><para><strong>Convert to man pages using pure-XSLT db2x_manxml</strong></para><example>$ xsltproc -o mydoc.mxml \
    docbook2X-path/xslt/man/docbook.xsl \
    mydoc.xml
$ xsltproc \
    docbook2X-path/xslt/backend/db2x_manxml.xsl \
    mydoc.mxml</example>

<anchor id="xsltproc.db2x_texixml"/><para><strong>Convert to Texinfo using Pure-XSLT db2x_texixml</strong></para><example>$ xsltproc -o mydoc.txml \
    docbook2X-path/xslt/texi/docbook.xsl \
    mydoc.xml
$ xsltproc \
    docbook2X-path/xslt/backend/db2x_texixml.xsl \
    mydoc.txml</example>
</para><para>
Here, 
xsltproc(1) is used instead of <code>db2x_xsltproc</code>, since
if you are in a situtation where you cannot use the Perl implementation 
of <code>db2x_manxml</code>, you probably cannot use <code>db2x_xsltproc</code> either.
</para><para>
If for portability reasons you prefer not to use the file-system path 
to the docbook2X files, you can use the XML catalog
provided in <file>xslt/catalog.xml</file>
and the global URIs contained therein.
</para><menu><menuentry idref="db2x_xsltproc"><menuentrytitle><code>db2x_xsltproc</code></menuentrytitle><menuentrydescrip>XSLT processor invocation wrapper</menuentrydescrip></menuentry><menuentry idref="sgml2xml-isoent"><menuentrytitle><code>sgml2xml-isoent</code></menuentrytitle><menuentrydescrip>Convert SGML to XML with support for ISO
entities</menuentrydescrip></menuentry></menu><node id="db2x_xsltproc" nextid="sgml2xml-isoent" upid="xsltproc"/><section><code>db2x_xsltproc</code></section><indexterm class="cp">XSLT processor</indexterm><indexterm class="cp">libxslt</indexterm><indexterm class="cp"><code>db2x_xsltproc</code></indexterm><subheading>Name</subheading><para><code>db2x_xsltproc</code> — XSLT processor invocation wrapper</para><subheading>Synopsis</subheading><quotation><para><t>db2x_xsltproc [options]  xml-document </t></para></quotation><subheading>Description</subheading><para>
<code>db2x_xsltproc</code> invokes the XSLT 1.0 processor for docbook2X.
</para><para>
This command applies the XSLT stylesheet 
(usually given by the <code>--stylesheet</code> option)
to the XML document in the file <var>xml-document</var>.
The result is written to standard output (unless changed with 
<code>--output</code>).  
</para><para>
To read the source XML document from standard input,
specify <samp>-</samp> as the input document.
</para><subheading>Options</subheading><varlist><varlistentry><term><code>--version</code></term><listitem><para>
Display the docbook2X version.
</para></listitem></varlistentry></varlist><subsubheading>Transformation output options</subsubheading><varlist><varlistentry><term><code>--output <var>file</var></code></term><term><code>-o <var>file</var></code></term><listitem><para>
Write output to the given file (or URI), instead of standard output.
</para></listitem></varlistentry></varlist><subsubheading>Source document options</subsubheading><varlist><varlistentry><term><code>--xinclude</code></term><term><code>-I</code></term><listitem><para>
Process XInclude directives in the source document.
</para></listitem></varlistentry><varlistentry><term><code>--sgml</code></term><term><code>-S</code></term><listitem><indexterm class="cp">SGML</indexterm><para>
Indicate that the input document is SGML instead of XML.
You need this set this option if <var>xml-document</var>
is actually a SGML file.
</para><para>
SGML parsing is implemented by conversion to XML via 
sgml2xml(1) from the
SP package (or 
osx(1) from the OpenSP package).  All tag names in the
SGML file will be normalized to lowercase (i.e. the <code>-xlower</code>
option of 
sgml2xml(1) is used).  ID attributes are available
for the stylesheet (i.e. option <code>-xid</code>).  In addition,
any ISO SDATA entities used in the SGML document are automatically converted
to their XML Unicode equivalents.  (This is done by a
<code>sed</code> filter.)
</para><para>
The encoding of the SGML document, if it is not
<samp>us-ascii</samp>, must be specified with the standard
SP environment variables: <samp>SP_CHARSET_FIXED=1
SP_ENCODING=<var>encoding</var></samp>.
(Note that XML files specify their encoding with the XML declaration
<samp>&lt;?xml version="1.0" encoding="<var>encoding"</var> ?&gt;</samp>
at the top of the file.)
</para><para>
The above conversion options cannot be changed.  If you desire different
conversion options, you should invoke 
sgml2xml(1) manually, and then pass
the results of that conversion to this program.
</para></listitem></varlistentry></varlist><subsubheading>Retrieval options</subsubheading><varlist><varlistentry><term><code>--catalogs <var>catalog-files</var></code></term><term><code>-C <var>catalog-files</var></code></term><listitem><indexterm class="cp">catalog</indexterm><para>
Specify additional XML catalogs to use for resolving Formal
Public Identifiers or URIs.  SGML catalogs are not supported.
</para><para>
These catalogs are <emph>not</emph> used for parsing an SGML
document under the <code>--sgml</code> option.  Use
the environment variable <env>SGML_CATALOG_FILES</env> instead 
to specify the catalogs for parsing the SGML document.
</para></listitem></varlistentry><varlistentry><term><code>--network</code></term><term><code>-N</code></term><listitem><para>
<code>db2x_xsltproc</code> will normally refuse to load
external resources from the network, for security reasons.  
If you do want to load from the network, set this option.
</para><para>
Usually you want to have installed locally the relevent DTDs and other
files, and set up catalogs for them, rather than load them automatically
from the network.
</para></listitem></varlistentry></varlist><subsubheading>Stylesheet options</subsubheading><varlist><varlistentry><term><code>--stylesheet <var>file</var></code></term><term><code>-s <var>file</var></code></term><listitem><para>
Specify the filename (or URI) of the stylesheet to use.  
The special values <samp>man</samp> and <samp>texi</samp> 
are accepted as abbreviations, to specify that
<var>xml-document</var> is in DocBook and
should be converted to man pages or Texinfo (respectively).
</para></listitem></varlistentry><varlistentry><term><code>--param <var>name</var>=<var>expr</var></code></term><term><code>-p <var>name</var>=<var>expr</var></code></term><listitem><para>
Add or modify a parameter to the stylesheet.
<var>name</var> is a XSLT parameter name, and
<var>expr</var> is an XPath expression that evaluates to
the desired value for the parameter.  (This means that strings must be
quoted, <emph>in addition</emph> to the usual quoting of shell
arguments; use <code>--string-param</code> to avoid this.)
</para></listitem></varlistentry><varlistentry><term><code>--string-param <var>name</var>=<var>string</var></code></term><term><code>-g <var>name</var>=<var>string</var></code></term><listitem><para>
Add or modify a string-valued parameter to the stylesheet.
</para><para>
The string must be encoded in UTF-8 (regardless of the locale 
character encoding).
</para></listitem></varlistentry></varlist><subsubheading>Debugging and profiling</subsubheading><varlist><varlistentry><term><code>--debug</code></term><term><code>-d</code></term><listitem><para>
Display, to standard error, logs of what is happening during the 
XSL transformation.
</para></listitem></varlistentry><varlistentry><term><code>--nesting-limit <var>n</var></code></term><term><code>-D <var>n</var></code></term><listitem><para>
Change the maximum number of nested calls to XSL templates, used to
detect potential infinite loops.  
If not specified, the limit is 500 (libxslt’s default).
</para></listitem></varlistentry><varlistentry><term><code>--profile</code></term><term><code>-P</code></term><listitem><para>
Display profile information: the total number of calls to each template
in the stylesheet and the time taken for each.  This information is
output to standard error.
</para></listitem></varlistentry><varlistentry><term><code>--xslt-processor <var>processor</var></code></term><term><code>-X <var>processor</var></code></term><listitem><para>
Select the underlying XSLT processor used.  The possible choices for
<var>processor</var> are: <samp>libxslt</samp>, <samp>saxon</samp>, <samp>xalan-j</samp>.
</para><para>
The default processor is whatever was set when docbook2X was built.
libxslt is recommended (because it is lean and fast),
but SAXON is much more robust and would be more helpful when
debugging stylesheets.
</para><para>
All the processors have XML catalogs support enabled.
(docbook2X requires it.)
But note that not all the options above work with processors
other than the libxslt one.
</para></listitem></varlistentry></varlist><subheading>Environment</subheading><varlist><varlistentry><term><env>XML_CATALOG_FILES</env></term><listitem><para>Specify XML Catalogs.
If not specified, the standard catalog
(<file>/etc/xml/catalog</file>) is loaded, if available.
</para></listitem></varlistentry><varlistentry><term><env>DB2X_XSLT_PROCESSOR</env></term><listitem><para>Specify the XSLT processor to use.
The effect is the same as the <code>--xslt-processor</code>
option.  The primary use of this variable is to allow you to quickly 
test different XSLT processors without having to add 
<code>--xslt-processor</code> to every script or make file in 
your documentation build system.
</para></listitem></varlistentry></varlist><subheading>Conforming to</subheading><para>
<uref url="http://www.w3.org/TR/xslt">XML Stylesheet Language – Transformations (XSLT), version
1.0</uref>, a W3C Recommendation.
</para><subheading>Notes</subheading><indexterm class="cp">XSLT extensions</indexterm><para>
In its earlier versions (&lt; 0.8.4),
docbook2X required XSLT extensions to run, and
<code>db2x_xsltproc</code> was a special libxslt-based processor that had these
extensions compiled-in. When the requirement for XSLT extensions
was dropped, <code>db2x_xsltproc</code> became a Perl script which translates
the options to <code>db2x_xsltproc</code> to conform to the format accepted by
the stock 
xsltproc(1) which comes with libxslt.
</para><para>The prime reason for the existence of this script
is backward compatibility with any scripts
or make files that invoke docbook2X.  However,
it also became easy to add in support for invoking
other XSLT processors with a unified command-line interface.
Indeed, there is nothing special in this script to docbook2X, 
or even to DocBook, and it may be used for running other sorts of
stylesheets if you desire.  Certainly the author prefers using this
command, because its invocation format is sane and is easy to 
use.  (e.g. no typing long class names for the Java-based processors!)
</para><subheading>See Also</subheading><para>
You may wish to consult the documentation that comes
with libxslt, SAXON, or Xalan.  The W3C XSLT 1.0 specification
would be useful for writing stylesheets.
</para><node id="sgml2xml-isoent" previousid="db2x_xsltproc" upid="xsltproc"/><section><code>sgml2xml-isoent</code></section><indexterm class="cp">SGML</indexterm><indexterm class="cp">ISO entities</indexterm><indexterm class="cp"><code>sgml2xml-isoent</code></indexterm><indexterm class="cp">DocBook</indexterm><subheading>Name</subheading><para><code>sgml2xml-isoent</code> — Convert SGML to XML with support for ISO
entities</para><subheading>Synopsis</subheading><quotation><para><t>sgml2xml-isoent [sgml-document]</t></para></quotation><subheading>Description</subheading><para>
<code>sgml2xml-isoent</code> converts an SGML document to XML,
with support for the ISO entities.
This is done by using 
sgml2xml(1) from the
SP package (or 
osx(1) from the OpenSP package),
and the declaration for the XML version of the ISO entities
is added to the output.
This means that the output of this conversion
should work as-is with any XML tool.
</para><para>
This program is often used for processing SGML DocBook documents
with XML-based tools.  In particular, <ref idref="db2x_xsltproc"><code>db2x_xsltproc</code></ref>
calls this program as part of its <code>--sgml</code>
option.  On the other hand, it is probably not helpful for 
migrating a source SGML text file to XML, since the conversion 
mangles the original formatting.
</para><para>
Since the XML version of the ISO entities 
are referred to directly, not via a DTD, this tool 
also works with document types other than DocBook.
</para><subheading>Notes</subheading><para>
The ISO entities are referred using the public identifiers 
<samp>ISO 8879:1986//ENTITIES//<var>…</var>//EN//XML</samp>.  
The catalogs used when parsing the converted document should 
resolve these entities to the appropriate place (on the local
filesystem).  If the entities are not resolved in the catalog, 
then the fallback is to get the entity files
from the <samp>http://www.docbook.org/</samp> Web site.
</para><subheading>See Also</subheading><para>

sgml2xml(1), 
osx(1)
</para><node id="charsets" previousid="xsltproc" nextid="faq" upid="docbook2X"/><chapter>Character set conversion</chapter><indexterm class="cp">character map</indexterm><indexterm class="cp">character sets</indexterm><indexterm class="cp">charsets</indexterm><indexterm class="cp">encoding</indexterm><indexterm class="cp">transliteration</indexterm><indexterm class="cp">re-encoding</indexterm><indexterm class="cp">UTF-8</indexterm><indexterm class="cp">Unicode</indexterm><indexterm class="cp"><code>utf8trans</code></indexterm><indexterm class="cp">escapes</indexterm><indexterm class="cp"><code>iconv</code></indexterm><para>
When translating XML to legacy ASCII-based formats
with poor support for Unicode, such as man pages and Texinfo,
there is always the problem that Unicode characters in
the source document also have to be translated somehow.
</para><para>
A straightforward character set conversion from Unicode 
does not suffice,
because the target character set, usually US-ASCII or ISO Latin-1,
do not contain common characters such as 
dashes and directional quotation marks that are widely
used in XML documents.  But document formatters (man and Texinfo)
allow such characters to be entered by a markup escape:
for example, <code>\(lq</code> for the left directional quote 
<samp>“</samp>.
And if a markup-level escape is not available,
an ASCII transliteration might be used: for example,
using the ASCII less-than sign <code>&lt;</code> for 
the angle quotation mark <code>〈</code>.
</para><para>
So the Unicode character problem can be solved in two steps:
</para><enumerate><listitem><para>
<ref idref="utf8trans"><code>utf8trans</code></ref>, a program included in docbook2X, maps
Unicode characters to markup-level escapes or transliterations.
</para><para>
Since there is not necessarily a fixed, official mapping of Unicode characters,
<code>utf8trans</code> can read in user-modifiable character mappings 
expressed in text files and apply them.  (Unlike most character
set converters.)
</para><para>
In <file>charmaps/man/roff.charmap</file>
and <file>charmaps/man/texi.charmap</file>
are character maps that may be used for man-page and Texinfo conversion.
The programs <ref idref="db2x_manxml"><code>db2x_manxml</code></ref> and <ref idref="db2x_texixml"><code>db2x_texixml</code></ref> will apply
these character maps, or another character map specified by the user,
automatically.
</para></listitem><listitem><para>
The rest of the Unicode text is converted to some other character set 
(encoding).
For example, a French document with accented characters 
(such as <samp>é</samp>) might be converted to ISO Latin 1.
</para><para>
This step is applied after <code>utf8trans</code> character mapping,
using the 
iconv(1) encoding conversion tool.
Both <ref idref="db2x_manxml"><code>db2x_manxml</code></ref> and <ref idref="db2x_texixml"><code>db2x_texixml</code></ref> can call

iconv(1) automatically when producing their output.
</para></listitem></enumerate><menu><menuentry idref="utf8trans"><menuentrytitle><code>utf8trans</code></menuentrytitle><menuentrydescrip>Transliterate UTF-8 characters according to a table</menuentrydescrip></menuentry></menu><node id="utf8trans" upid="charsets"/><section><code>utf8trans</code></section><indexterm class="cp">character map</indexterm><indexterm class="cp">UTF-8</indexterm><indexterm class="cp">Unicode</indexterm><indexterm class="cp"><code>utf8trans</code></indexterm><indexterm class="cp">escapes</indexterm><indexterm class="cp">transliteration</indexterm><subheading>Name</subheading><para><code>utf8trans</code> — Transliterate UTF-8 characters according to a table</para><subheading>Synopsis</subheading><quotation><para><t>utf8trans  charmap  [file]…</t></para></quotation><subheading>Description</subheading><indexterm class="cp">utf8trans</indexterm><para>
<code>utf8trans</code> transliterates characters in the specified files (or 
standard input, if they are not specified) and writes the output to
standard output.  All input and output is in the UTF-8 encoding.  
</para><para>
This program is usually used to render characters in Unicode text files
as some markup escapes or ASCII transliterations.
(It is not intended for general charset conversions.)
It provides functionality similar to the character maps
in XSLT 2.0 (XML Stylesheet Language – Transformations, version 2.0).
</para><subheading>Options</subheading><varlist><varlistentry><term><code>-m</code></term><term><code>--modify</code></term><listitem><para>
        Modifies the given files in-place with their transliterated output,
        instead of sending it to standard output.
      </para><para>
        This option is useful for efficient transliteration of many files
        at once.
      </para></listitem></varlistentry><varlistentry><term><code>--help</code></term><listitem><para>Show brief usage information and exit.</para></listitem></varlistentry><varlistentry><term><code>--version</code></term><listitem><para>Show version and exit.</para></listitem></varlistentry></varlist><subheading>Usage</subheading><para>
The translation is done according to the rules in the ‘character
map’, named in the file <var>charmap</var>.  It
has the following format:

<enumerate><listitem><para>Each line represents a translation entry, except for
blank lines and comment lines, which are ignored.</para></listitem><listitem><para>Any amount of whitespace (space or tab) may precede 
the start of an entry.</para></listitem><listitem><para>Comment lines begin with <samp>#</samp>.
Everything on the same line is ignored.</para></listitem><listitem><para>Each entry consists of the Unicode codepoint of the
character to translate, in hexadecimal, followed
<emph>one</emph> space or tab, followed by the translation
string, up to the end of the line.</para></listitem><listitem><para>The translation string is taken literally, including any
leading and trailing spaces (except the delimeter between the codepoint
and the translation string), and all types of characters.  The newline
at the end is not included.  </para></listitem></enumerate>
</para><para>
The above format is intended to be restrictive, to keep
<code>utf8trans</code> simple.  But if a XML-based format is desired,
there is a <file>xmlcharmap2utf8trans</file> script that 
comes with the docbook2X distribution, that converts character
maps in XSLT 2.0 format to the <code>utf8trans</code> format.
</para><subheading>Limitations</subheading><itemize markchar="&#x2022;"><listitem><para>
<code>utf8trans</code> does not work with binary files, because malformed
UTF-8 sequences in the input are substituted with
U+FFFD characters.  However, null characters in the input
are handled correctly. This limitation may be removed in the future.
</para></listitem><listitem><para>
There is no way to include a newline or null in the substitution string.
</para></listitem></itemize><node id="faq" previousid="charsets" nextid="performance" upid="docbook2X"/><chapter>FAQ</chapter><indexterm class="cp">FAQ</indexterm><indexterm class="cp">tips</indexterm><indexterm class="cp">problems</indexterm><indexterm class="cp">bugs</indexterm><varlist><varlistentry><term>  Q:</term><listitem><para>I have a SGML DocBook document.  How do I use docbook2X?</para><indexterm class="cp">SGML</indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
Use the <code>--sgml</code> option to <code>db2x_xsltproc</code>.
</para><para>
(Formerly, we described a quite intricate hack here to convert
to SGML to XML while preserving the ISO entities.  That hack
is actually what <code>--sgml</code> does.)
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>docbook2X bombs with this document!</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>It is probably a bug in docbook2X.  (Assuming that the input
document is valid DocBook in the first place.)  Please file a bug
report.  In it, please include the document which causes
docbook2X to fail, or a pointer to it, or a test case that reproduces
the problem.</para><para>
I don’t want to hear about bugs in obsolete tools (i.e. tools that are
not in the current release of docbook2X.)  I’m sorry, but maintaining all
that is a lot of work that I don’t have time for.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
Must I use <code>refentry</code>
to write my man pages?
</para><indexterm class="cp"><code>refentry</code></indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
Under the default settings of docbook2X: yes, you have to.
The contents of the source document
that lie outside of <code>refentry</code>
elements are probably written in a book/article style
that is usually not suited for the reference style of man pages.
</para><para>
Nevertheless, sometimes you might want to include inside your man page,
(small) snippets or sections of content from other parts of your book
or article.
You can achieve this by using a custom XSLT stylesheet to include
the content manually.
The docbook2X documentation demonstrates this technique:
see the 
  docbook2man(1)

and the
  docbook2texi(1)

man pages and the stylesheet that produces them
 in <file>doc/ss-man.xsl</file>.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
Where have the SGML-based docbook2X tools gone?
</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
They are in a separate package now, docbook2man-sgmlspl.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
I get some <code>iconv</code> error when converting documents.
</para><indexterm class="cp"><code>iconv</code></indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
It's because there is some Unicode character in your document
that docbook2X fails to convert to ASCII or a markup escape (in roff
or Texinfo).  The error message is intentional because it alerts
you to a possible loss of information in your document, although
admittedly it could be less cryptic, but I unfortunately can't control what
<code>iconv</code> says.
</para><para>
You can look at the partial man or Texinfo output — the offending
Unicode character should be near the point that the output is
interrupted.  Since you probably wanted that Unicode character
to be there, the way you want to fix this error is to add
a translation for that Unicode character to the <code>utf8trans</code> character map.
Then use the <code>--utf8trans-map</code> option to the Perl
docbook2X tools to use your custom character map.
</para><para>
Alternatively, if you want to close your eyes to the utterly broken
Unicode handling in groff and Texinfo, just use the 
<code>--encoding=utf-8</code> option.
Note that the UTF-8 output is unlikely to display correctly everywhere.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
Texinfo output looks ugly.
</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
You have to keep in mind that Info is extremely limited in its
formatting.  Try setting the various parameters to the stylesheet
(see <file>xslt/texi/param.xsl</file>).
</para><para>
Also, if you look at native Info pages, you will see there is a certain 
structure, that your DocBook document may not adhere to.  There is
really no fix for this.  It is possible, though, to give rendering
hints to the Texinfo stylesheet in your DocBook source, like this this 
manual does. Unfortunately these are not yet documented in a prominent place.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
How do I use SAXON (or Xalan-Java) with docbook2X?
</para><indexterm class="cp">SAXON</indexterm><indexterm class="cp">Xalan-Java</indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
Bob Stayton’s <i>DocBook XSL: The Complete Guide</i>
has a nice 
<uref url="http://www.sagehill.net/docbookxsl/InstallingAProcessor.html">
section on setting up the XSLT processors</uref>.
It talks about Norman Walsh’s DocBook XSL stylesheets,
but for docbook2X you only need to change the stylesheet
argument (any file with the extension <file>.xsl</file>).
</para><para>
If you use the Perl wrapper scripts provided with docbook2X,
you only need to “install” the XSLT processors (i.e. for Java, copying 
the <file>*.jar</file> files to 
<file>/usr/local/share/java</file>), and you don’t
need to do anything else.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
XML catalogs don’t work with Xalan-Java.
(Or: Stop connecting to the Internet when running docbook2X!)
</para><indexterm class="cp">Xalan-Java</indexterm><indexterm class="cp">catalog</indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
I have no idea why — XML catalogs with Xalan-Java don’t work for me
either, no matter how hard I try.  Just go use SAXON or libxslt instead
(which do work for me at least).
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>I don’t like how docbook2X renders this markup.</para><indexterm class="cp">rendering</indexterm><indexterm class="cp">customizing</indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>The XSLT stylesheets are customizable, so assuming you have
knowledge of XSLT, you should be able to change the rendering easily.  
See <file>doc/ss-texinfo.xsl</file> of docbook2X’s own
documentation for a non-trivial example.
</para><para>
If your customizations can be generally useful, I would like to hear
about it.
</para><para>
If you don't want to muck with XSLT, you can still tell me what sort
of features you want.  Maybe other users want them too.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>Does docbook2X support other XML document types
or output formats?</para><indexterm class="cp">other output formats</indexterm><indexterm class="cp">other document types</indexterm><indexterm class="cp">non-DocBook document type</indexterm></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
No.  But if you want to create code for a new XML document type
or output format, the existing infrastructure of docbook2X may be able
to help you.
</para><para>
For example, if you want to convert a document in the W3C 
spec DTD to Texinfo, you can write a XSLT stylesheet that outputs a 
document conformant to the Texi-XML, and run that through <code>db2x_texixml</code>
to get your Texinfo pages.  Writing the said XSLT
stylesheet should not be any more difficult than if you were
to write a stylesheet for HTML output, in fact probably even easier.
</para><para>
An alternative approach is to convert the source document
to DocBook first, then apply docbook2X conversion afterwards.
The stylesheet reference documentation in docbook2X uses this technique:
the documentation embedded in the XSLT stylesheets is first extracted
into a DocBook document, then that is converted to Texinfo.
This approach obviously is not ideal if the source
document does not map well into DocBook,
but it does allow you to use the standard DocBook HTML
and XSL-FO stylesheets to format the source document with little effort.
</para><para>
If you want, on the other hand, to get troff output but 
using a different macro set, you will have to rewrite both the
stylesheets and the post-processor (performing the function of
<code>db2x_manxml</code> but with a different macro set).
In this case some of the code in <code>db2x_manxml</code> may be reused, and you 
can certainly reuse <code>utf8trans</code> and the provided roff character maps.
</para></listitem></varlistentry></varlist><node id="performance" previousid="faq" nextid="testing" upid="docbook2X"/><chapter>Performance analysis</chapter><indexterm class="cp">speed</indexterm><indexterm class="cp">performance</indexterm><indexterm class="cp">optimize</indexterm><indexterm class="cp">efficiency</indexterm><para>
The performance of docbook2X,
and most other DocBook tools<footnote>with the notable exception of the 
<uref url="http://packages.debian.org/unstable/text/docbook-to-man">docbook-to-man tool</uref>
based on the <code>instant</code> stream processor
(but this tool has many correctness problems)
</footnote>
can be summed up in a short phrase:
<emph>they are slow</emph>.
</para><para>
On a modern computer producing only a few man pages
at a time, 
with the right software — namely, libxslt as the XSLT processor —
the DocBook tools are fast enough.
But their slowness becomes a hindrance for
generating hundreds or even thousands of man pages
at a time.
</para><para>
The author of docbook2X encounters this problem
whenever he tries to do automated tests of the docbook2X package.
Presented below are some actual benchmarks, and possible approaches
 to efficient DocBook  to man pages conversion.
</para><para><strong>docbook2X running times on 2157 
refentry documents</strong></para><multitable cols="3"><tbody><row><entry>Step</entry><entry>Time for all pages</entry><entry>Avg. time per page</entry></row><row><entry>DocBook to Man-XML</entry><entry>519.61 s</entry><entry>0.24 s</entry></row><row><entry>Man-XML to man-pages</entry><entry>383.04 s</entry><entry>0.18 s</entry></row><row><entry>roff character mapping</entry><entry>6.72 s</entry><entry>0.0031 s</entry></row><row><entry>Total</entry><entry>909.37 s</entry><entry>0.42 s</entry></row></tbody></multitable><para>
The above benchmark was run on 2157 documents 
coming from the <uref url="http://www.catb.org/~esr/doclifter/">doclifter</uref> man-page-to-DocBook conversion tool.  The man pages
come from the section 1 man pages installed in the 
author’s Linux system.
The XML files total 44.484 MiB, and on average are 20.6KiB long. 
</para><para>
The results were obtained using the test script in 
<file>test/mass/test.pl</file>,
using the default man-page conversion options.
The test script employs the obvious optimizations, 
such as only loading once the XSLT processor, the 
man-pages stylesheet, <code>db2x_manxml</code> and <code>utf8trans</code>.
</para><para>
Unfortunately, there does not seem to be obvious ways
that the performance can be improved, short of re-implementing the
tranformation program in a tight programming language such as C.
</para><para>
Some notes on possible bottlenecks:

<itemize markchar="&#x2022;"><listitem><para>
      Character mapping by <code>utf8trans</code> is very fast compared to 
      the other stages of the transformation.  Even loading <code>utf8trans</code>
      separately for each document only doubles the running time
      of the character mapping stage.
    </para></listitem><listitem><para>
      Even though the XSLT processor is written in C,
      XSLT processing is still comparatively slow.
      It takes double the time of the Perl script<footnote>
From preliminary estimates, the Pure-XSLT solution takes only 
slightly longer at this stage: .22 s per page</footnote>
      <code>db2x_manxml</code>,
      even though the XSLT portion and the Perl portion
      are processing documents of around the same size<footnote>Of course, conceptually, DocBook processing is more complicated.
So these timings also give us an estimate of the cost
of DocBook’s complexity: twice the cost over a simpler document type,
which is actually not too bad.</footnote>
      (DocBook <code>refentry</code>
       documents and Man-XML documents).  
    </para><para>
      In fact, profiling the stylesheets shows that a significant
      amount of time is spent on the localization templates,
      in particular the complex XPath navigation used there.
      An obvious optimization is to use XSLT keys for the same
      functionality.  
    </para><para>
      However, when that is implemented,
      the author found that the time used for 
      <emph>setting up keys</emph> dwarfs the time savings
      from avoiding the complex XPath navigation.  It adds an
      extra 10s to the processing time for the 2157 documents.
      Upon closer examination of the libxslt source code,
      XSLT keys are seen to be implemented rather inefficiently:
      <emph>each</emph> key pattern <var>x</var>
      causes the entire input document to be traversed once
      by evaluating the XPath <samp>//<var>x</var></samp>!
    </para></listitem><listitem><para>
      Perhaps a C-based XSLT processor written
      with the best performance in mind (libxslt is not particularly
      the most efficiently coded) may be able to achieve
      better conversion times, without losing all the nice
      advantages of XSLT-based tranformation.
      Or failing that, one can look into efficient, stream-based
      transformations (<uref url="http://stx.sourceforge.net/">STX</uref>).
    </para></listitem></itemize>
</para><node id="testing" previousid="performance" nextid="todo" upid="docbook2X"/><chapter>How docbook2X is tested</chapter><indexterm class="cp">testing</indexterm><indexterm class="cp">correctness</indexterm><indexterm class="cp">validation</indexterm><para>
The testing of the process of converting from DocBook to man pages, or Texinfo,
is complicated by the fact
that a given input (the DocBook document) usually
does not have one specific, well-defined output.
Variations on the output are allowed for the result to look “nice”.
</para><para>
When docbook2X was in the early stages of development,
the author tested it simply by running some sample DocBook documents
through it, and visually inspecting the output.
</para><para>
Clearly, this procedure is not scaleable for testing
a large number of documents.
In the later 0.8.<var>x</var> versions
of docbook2X, the testing has been automated
as much as possible.
</para><para>
The testing is implemented by 
heuristic checks on the output to see if
it comprises a “good” man page or Texinfo file.
These are the checks in particular:
</para><enumerate><listitem><para>
      Validation of the Man-XML or Texi-XML output,
      from the first stage, XSLT stylesheets,
      against the XML DTDs defining the formats.
    </para></listitem><listitem><para>
      Running 
groff(1) and 
makeinfo(1)
      on the output, and noting any errors
      or warnings from those programs.
    </para></listitem><listitem><para>
      Other heuristic checks on the output,
      implemented by a Perl script.  Here,
      spurious blank lines, uncollapsed whitespace
      in the output that would cause a bad display 
      are checked.
    </para></listitem></enumerate><para>
There are about 8000 test documents,
mostly <code>refentry</code>
documents,  that can be run
against the current version of docbook2X.
A few of them have been gathered by the author
from various sources and test cases from bug reports.
The majority come from using 
<uref url="http://www.catb.org/~esr/doclifter/">doclifter</uref>
on existing man pages.
Most pages pass the above tests.
</para><para>
To run the tests, go to the <file>test/</file>
directory in the docbook2X distribution.
The command <samp>make check</samp> will run
some tests on a few documents.
</para><para>
For testing using doclifter,
first generate the DocBook XML sources using doclifter,
then take a look at the <file>test/mass/test.pl</file>
testing script and run it.
Note that a small portion of the doclifter pages
will fail the tests, because they do not satisfy the heuristic
tests (but are otherwise correct), or, more commonly,
the source coming from the doclifter heuristic up-conversion 
has errors.
</para><node id="todo" previousid="testing" nextid="changes" upid="docbook2X"/><chapter>To-do list</chapter><indexterm class="cp">to-do</indexterm><indexterm class="cp">future</indexterm><indexterm class="cp">bugs</indexterm><indexterm class="cp">wishlist</indexterm><indexterm class="cp">DocBook</indexterm><para>
  With regards to DocBook support:

  <itemize markchar="&#x2022;"><listitem><para>
        <code>qandaset</code> table of contents
        Perhaps allow <code>qandadiv</code>
        elements to be nodes in Texinfo.
      </para></listitem><listitem><para>
        <code>olink</code>
	(do it like what the DocBook XSL stylesheets do)
      </para></listitem><listitem><para>
        <code>synopfragmentref</code>
      </para></listitem><listitem><para>
        Man pages should support <code>qandaset</code>, <code>footnote</code>, <code>mediaobject</code>, <code>bridgehead</code>, 
        <code>synopfragmentref</code>
        <code>sidebar</code>,
        <code>msgset</code>,
        <code>procedure</code>
        (and there's more).
      </para></listitem><listitem><para>
        Some DocBook 4.0 stuff:
        e.g. <code>methodsynopsis</code>.
        On the other hand adding the DocBook 4.2 stuff shouldn't be that hard.
      </para></listitem><listitem><para>
        <code>programlisting</code>
        line numbering, and call-out bugs specified
        using <code>area</code>.
        Seems to need XSLT extensions though.
      </para></listitem><listitem><para>
        A template-based system for title pages, and <code>biblioentry</code>.
      </para></listitem><listitem><para>
        Setting column widths in tables are not yet supported in man
        pages, but they should be.
      </para></listitem><listitem><para>
        Support for typesetting mathematics.
        However, I have never seen any man pages or Texinfo manuals
        that require this, obviously because math looks horrible
        in ASCII text.
      </para></listitem></itemize>
</para><para>
For other work items, see the ‘limitations’ or
‘bugs’ section in the individual tools’ reference pages.
</para><para>
  Other work items:

  <itemize markchar="&#x2022;"><listitem><para>
        Implement tables in pure XSLT.  Probably swipe the code
        that is in the DocBook XSL stylesheets to do so.
      </para></listitem><listitem><para>
        Many stylesheet templates are still undocumented.
      </para></listitem><listitem><para>
        Write documentation for Man-XML and Texi-XML. 
        Write a smaller application (smaller than DocBook, that is!) 
        of Man-XML and/or Texi-XML (e.g. for W3C specs).
        A side benefit is that we can identify any bugs or design
        misfeatures that are not noticed in the DocBook application.
      </para></listitem><listitem><para>
        Need to go through the stylesheets and check/fill in
        any missing DocBook functionality.  Make a table
        outlining what part of DocBook we support.
      </para><para>
        For example, we have to check that each attribute
        is actually supported for an element that we claim 
        to support, or else at least raise a warning to the
        user when that attribute is used.
      </para><para>
        Also some of the DocBook elements are not rendered
        very nicely even when they are supported.
      </para></listitem><listitem><para>Fault-tolerant, complete error handling.</para></listitem><listitem><para>
        Full localization for the output, as well as the messages
        from docbook2X programs.  (Note that 
        we already have internationalization for the output.)
      </para></listitem></itemize>
</para><node id="changes" previousid="todo" nextid="design-notes" upid="docbook2X"/><chapter>Release history</chapter><indexterm class="cp">change log</indexterm><indexterm class="cp">history</indexterm><indexterm class="cp">release history</indexterm><indexterm class="cp">news</indexterm><indexterm class="cp">bugs</indexterm><para><anchor id="changes-0.8.8"/><strong>docbook2X 0.8.8. </strong> 
  <itemize markchar="&#x2022;"><listitem><para>
        Errors in the Man-XML and Texi-XML DTD were fixed.
      </para><para>
        These DTDs are now used to validate the output coming
        out of the stylesheets, as part of automated testing.
        (Validation provides some assurance that the
         result of the conversions are correct.)
      </para></listitem><listitem><para>
        Several rendering errors were fixed after
        they had been discovered through automated testing.
      </para></listitem><listitem><para>
        Two HTML files in the docbook2X documentation were
        accidentally omitted in the last release.
        They have been added.
      </para></listitem><listitem><para>
        The pure-XSLT-based man-page conversion now supports
        table markup.  The implemented was copied from
        the one by Michael Smith in the DocBook XSL stylesheets.
        Many thanks!
      </para></listitem><listitem><para>
        As requested by Daniel Leidert,
        the man-pages stylesheets now support the 
        <code>segmentedlist</code>,
        <code>segtitle</code>
        and <code>seg</code>
        DocBook elements.
      </para></listitem><listitem><para>
        As suggested by Matthias Kievermagel, 
        docbook2X now supports the <code>code</code>
        element.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.7"/><strong>docbook2X 0.8.7. </strong> 
  <itemize markchar="&#x2022;"><listitem><para>
        Some stylistic improvements were made
        to the man-pages output.
      </para><para>
        This includes fixing a bug that, in some cases, caused
         an extra blank line to occur after lists in man pages.
      </para></listitem><listitem><para>
        There is a new value <samp>utf-8//TRANSLIT</samp>
        for the <code>--encoding</code> option
        to <code>db2x_manxml</code> and <code>db2x_texixml</code>.
      </para></listitem><listitem><para>
        Added <code>-m</code> to <code>utf8trans</code> for modifying
        (a large number of) files in-place.
      </para></listitem><listitem><para>
        Added a section to the documentation discussing conversion 
        performance.
      </para><para>
        There is also a new test script, 
        <file>test/mass/test.pl</file>
        that can exercise docbook2X by converting many documents
        at one time, with a focus on achieving the fastest
        conversion speed.
      </para></listitem><listitem><para>
        The documentation has also been improved in several places.
        Most notably, the 
          docbook2X(1)
        man page has been split into two much more detailed 
        man pages explaining
        man-page conversion and Texinfo conversion separately,
        along with a reference of stylesheet parameters.
      </para><para>
        The documentation has also been re-indexed (finally!)
      </para><para>
        Also, due to an oversight, the last release omitted the stylesheet
        reference documentation.  They are now included again.
      </para></listitem><listitem><para>
        Craig Ruff’s patches were not integrated correctly in the last
        release; this has been fixed.
      </para></listitem><listitem><para>
        By popular demand, man-page conversion can also be done
        with XSLT alone — i.e. no Perl scripts or compiling required,
        just a XSLT processor.
      </para><para>
        If you want to convert with pure XSLT, invoke 
        the XSLT stylesheet in 
        <file>xslt/backend/db2x_manxml.xsl</file>
        in lieu of the <code>db2x_manxml</code> Perl script.
      </para></listitem><listitem><para>
        Make the <code>xmlcharmap2utf8trans</code> script 
        (convert XSLT 2.0 character maps to character maps in utf8trans 
         format) really work.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.6"/><strong>docbook2X 0.8.6. </strong> 

  <itemize markchar="&#x2022;"><listitem><para>
        Added rudimentary support for <code>entrytbl</code>
        in man pages; patch by Craig Ruff.
      </para></listitem><listitem><para>
        Added template for <code>personname</code>; patch by Aaron Hawley.
      </para></listitem><listitem><para>
        Fix a build problem that happened on IRIX; patch by Dirk Tilger.
      </para></listitem><listitem><para>
        Better rendering of man pages in general.  Fixed
        an incompatibility with Solaris troff of some generated man pages.
      </para></listitem><listitem><para>
        Fixed some minor bugs in the Perl wrapper scripts.
      </para></listitem><listitem><para>
        There were some fixes to the Man-XML and Texi-XML document types.  
        Some of these changes are backwards-incompatible with previous
        docbook2X releases.  In particular, Man-XML and Texi-XML now
        have their own XML namespaces, so if you were using custom XSLT
        stylesheets you will need to add the appropriate namespace
        declarations.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.5"/><strong>docbook2X 0.8.5. </strong> 

  <itemize markchar="&#x2022;"><listitem><para>
        Fixed a bug, from version 0.8.4, with the generated Texinfo 
        files not setting the Info directory information correctly.
        (This is exactly the patch that was on the docbook2X Web site.)
      </para></listitem><listitem><para>
        Fixed a problem with <code>db2x_manxml</code> not calling <code>utf8trans</code> properly.
      </para></listitem><listitem><para>
        Added heavy-duty testing to the docbook2X distribution.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.4"/><strong>docbook2X 0.8.4. </strong> 

  <itemize markchar="&#x2022;"><listitem><para>
        There is now an <emph>experimental</emph>
        implementation of <code>db2x_manxml</code> and <code>db2x_texixml</code> using pure XSLT,
        for those who can’t use the Perl one for whatever reason.
        See the <file>xslt/backend/</file> directory.
        Do not expect this to work completely yet.  
        In particular, tables are not yet available in man pages.
        (They are, of course, still available in the Perl
        implementation.)
      </para></listitem><listitem><para>
        Texinfo conversion does not require XSLT extensions anymore!
        See <ref idref="xslt-extensions-move">Design notes: the       elimination of XSLT extensions</ref> for the full story.
      </para><para>
        As a consequence, <code>db2x_xsltproc</code> has been rewritten to be
        a Perl wrapper script around the stock 
xsltproc(1).
      </para></listitem><listitem><para>
        The <code>-S</code> option to <code>db2x_xsltproc</code>
        no longer uses libxml’s hackish “SGML DocBook” parser, but now 
        calls 
sgml2xml(1).
        The corresponding long option has been renamed to
        <code>--sgml</code> from <code>--sgml-docbook</code>.
      </para></listitem><listitem><para>
        Fixed a heap of bugs — that caused invalid output — in the 
        XSLT stylesheets, <code>db2x_manxml</code> and <code>db2x_texixml</code>.
      </para><para>
        Some features such as <code>cmdsynopsis</code>
        and <code>funcsynopsis</code>
        are rendered more nicely.
      </para></listitem><listitem><para>
        Man-XML and Texi-XML now have DTDs —
        these are useful when writing and debugging stylesheets.
      </para></listitem><listitem><para>
        Added a <code>--plaintext</code> option to <code>db2x_texixml</code>.
      </para></listitem><listitem><para>
        Updates to the docbook2X manual.
        Stylesheet documentation is in.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.3"/><strong>docbook2X 0.8.3. </strong> 

  <itemize markchar="&#x2022;"><listitem><para>
        Incorporated Michael Smith’s much-expanded roff character maps.
      </para></listitem><listitem><para>
        There are some improvements to the stylesheets themselves, here and 
        there.
      </para><para>
        Also I made the Texinfo stylesheets adapt to the XSLT processor
        automatically (with regards to the XSLT extensions).  This
        might be of interest to anybody wanting to use the stylesheets
        with some other XSLT processor (especially SAXON).
      </para></listitem><listitem><para>
        Fixed a couple of bugs that prevented docbook2X from 
        working on Cygwin.  
      </para></listitem><listitem><para>
        Fixed a programming error in <code>utf8trans</code> that caused it to
        segfault.  At the same time, I rewrote parts of it
        to make it more efficient for large character maps
        (those with more than a thousand entries).
      </para></listitem><listitem><para>
        The Perl component of docbook2X has switched from using
        libxml-perl (a SAX1 interface) to XML-SAX (a SAX2 interface).
        I had always wanted to do the switch since libxml-perl 
        is not maintained, but the real impetus this time is
        that XML-SAX has a pure Perl XML parser.  If you have
        difficulties building <code>XML::Parser</code>
        on Cygwin, like I did, the Perl component will automatically
        fall back on the pure Perl parser.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.2"/><strong>docbook2X 0.8.2. </strong> 

  <itemize markchar="&#x2022;"><listitem><para>
        Added support for tables in man pages.
        Almost all table features that can be supported with 
        <code>tbl</code> will work.
        The rest will be fixed in a subsequent release.
      </para></listitem><listitem><para>
        Copied the “gentext” stuff over from Norman Walsh’s XSL stylesheets.
        This gives (incomplete) localizations for the same languages
        that are supported by the Norman Walsh’s XSL stylesheets.
      </para><para>
        Although incomplete, they should be sufficient for localized
        man-page output, for which there are only a few strings
        like “Name” and “Synopsis” that need to be translated.
      </para><para>
        If you do make non-English man pages, you will need
        to revise the localization files; please send patches
        to fix them afterwards.
      </para></listitem><listitem><para>
      Rendering of bibliography, and other less common DocBook
      elements is broken.  Actually, it was probably also 
      slightly broken before.  Some time will be needed to
      go through the stylesheets to check/document everything in 
      it and to add anything that is still missing.
    </para></listitem><listitem><para>
      Added <code>--info</code> option to <code>db2x_texixml</code>,
      to save typing the <code>makeinfo</code> command.
    </para></listitem><listitem><para>
      Rename <code>--stringparam</code> option 
      in <code>db2x_xsltproc</code> to <code>--string-param</code>,
      though the former option name is still accepted
      for compatibility.
    </para></listitem><listitem><para>
      Added the stylesheet for generating the XSLT reference 
      documentation.  But the reference documentation is not 
      integrated into the main docbook2X documentation yet.
    </para></listitem><listitem><para>
      docbook2X no longer uses SGML-based tools to build.
      HTML documentation is now built with the DocBook XSL stylesheets.
    </para></listitem><listitem><para>
      Changed the license of this package to the MIT license.
      This is in case someone wants to copy snippets of the XSLT stylesheets,
      and requiring the resulting stylesheet to be GPL seems too onerous.
      Actually there is no real loss since no one wants to hide XSLT source
      anyway.
    </para></listitem><listitem><para>
      Switched to a newer version of autoconf.
    </para></listitem><listitem><para>
      Fixes for portability (to non-Linux OSes).
    </para></listitem><listitem><para>
      A number of small rendering bug fixes, as usual.
    </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.1"/><strong>docbook2X 0.8.1. </strong> 

  <itemize markchar="&#x2022;"><listitem><para>
        Bug fixes.
      </para></listitem><listitem><para>
        Texinfo menu generation has been improved: the menus now look almost
        as good as human-authored Texinfo pages and include detailed node listings
        (<code>@detailmenu</code>) also.
      </para></listitem><listitem><para>
        Added option to process XInclude in <code>db2x_xsltproc</code> just like standard
        <code>xsltproc</code>.
      </para></listitem></itemize>
  </para><para><anchor id="changes-0.8.0"/><strong>docbook2X 0.8.0. </strong> 
  
    <itemize markchar="&#x2022;"><listitem><para>
        Moved <code>docbook2man-spec.pl</code> to a sister package,
        docbook2man-sgmlspl, since it seems to be used quite a lot.
      </para></listitem><listitem><para>
        There are now XSLT stylesheets for man page conversion, superceding the
        <code>docbook2manxml</code>.  <code>docbook2manxml</code> had some neat code in it, but I
        fear maintaining two man-page converters will take too much time in the
        future, so I am dropping it now instead of later.
      </para></listitem><listitem><para>
        Fixed build errors involving libxslt headers, etc. that plagued the last
        release.  The libxslt wrapper (name changed to <code>db2x_xsltproc</code>, formerly
        called <code>docbook2texi-libxslt</code>) has been
        updated for the recent libxslt changes.  
        Catalog support working.
      </para></listitem><listitem><para>
        Transcoding output to non-UTF-8 charsets is automatic.  
      </para></listitem><listitem><para>
        Made some wrapper scripts for the two-step conversion process.
      </para></listitem></itemize>
  
  </para><para><anchor id="changes-0.7.0"/><strong>docbook2X 0.7.0. </strong> 
<itemize markchar="&#x2022;"><listitem><para>
More bug squashing and features in XSLT stylesheets and Perl scripts.  
Too many to list.
</para></listitem><listitem><para>
Added <code>docbook2texi-libxslt</code>, which uses libxslt.
Finally, no more Java is necessary.
</para></listitem><listitem><para>
Added a C-based tool to translate UTF-8 characters to arbitrary (byte)
sequences, to avoid having to patch <code>recode</code> every time
the translation changes.  However, Christoph Spiel has ported the recode
utf8..texi patch to GNU recode 3.6 if you prefer to use recode.
</para></listitem><listitem><para>As usual, the documentation has been improved.</para><para>The documentation for the XSLT stylesheets can be extracted
automatically.  (Caveat: libxslt has a bug which affects this process,
so if you want to build this part of the documentation yourself you must
use some other XSLT processor. There is no <code>jrefentry</code> support in docbook2X yet, so the
reference is packaged in HTML format; this will change in the next
release, hopefully.)
</para></listitem><listitem><para>
Build system now uses autoconf and automake.
</para></listitem></itemize>
</para><para><anchor id="changes-0.6.9"/><strong>docbook2X 0.6.9. </strong> 
<itemize markchar="&#x2022;"><listitem><para>
Removed old unmaintained code such as <code>docbook2man</code>,
<code>docbook2texi</code>.
Moved Perl scripts to <file>perl/</file> directory and did some
renaming of the scripts to saner names.
</para></listitem><listitem><para>
Better make system.
</para></listitem><listitem><para>
Debugged, fixed the XSLT stylesheets more and added libxslt invocation.
</para></listitem><listitem><para>
Cut down the superfluity in the documentation.
</para></listitem><listitem><para>
Fixed other bugs in <code>docbook2manxml</code> and the Texi-XML,
Man-XML tools.
</para></listitem></itemize>
</para><para><anchor id="changes-0.6.1"/><strong>docbook2X 0.6.1. </strong> 
<itemize markchar="&#x2022;"><listitem><para>
<code>docbook2man-spec.pl</code> has an option to strip or
not strip letters in man page section names, and xref may now refer to
<code>refsect<var>n</var></code>.
I have not personally tested these options, but loosing them
in the interests of release early and often.
</para></listitem><listitem><para>
Menu label quirks, <code>paramdef</code>
non-conformance, and vertical simplelists with multiple columns fixed in
<code>docbook2texixml</code>.
</para></listitem><listitem><para>
Brought <code>docbook2manxml</code> up
to speed. It builds its own documentation now.
</para></listitem><listitem><para>
Arcane bugs in <code>texi_xml</code> and <code>man_xml</code>
fixed.
</para></listitem></itemize>

  </para><para><anchor id="changes-0.6.0"/><strong>docbook2X 0.6.0. </strong> 
<itemize markchar="&#x2022;"><listitem><para>Introduced Texinfo XSLT stylesheets. </para></listitem><listitem><para>
Bugfixes to <code>texi_xml</code> and 
<code>docbook2texixml</code>. 
</para></listitem><listitem><para>Produced patch to GNU <code>recode</code> which maps Unicode
characters to the corresponding Texinfo commands or characters.
It is in <file>ucs2texi.patch</file>.
I have already sent this patch to the maintainer of <code>recode</code>.
</para></listitem><listitem><para>Updated documentation.</para></listitem></itemize>
</para><para><anchor id="changes-0.5.9"/><strong>docbook2X 0.5.9. </strong> 

<itemize markchar="&#x2022;"><listitem><para>
Both <code>docbook2texixml</code> transform into intermediate XML
format which closely resembles the Texinfo format, and then another
tool is used to convert this XML to the actual format.
</para><para>
This scheme moves all the messy whitespace, newline, and escaping issues
out of the actual transformation code.  Another benefit is that other
stylesheets (systems), can be used to do the transformation, and it
serves as a base for transformation to Texinfo from other
DTDs.
</para></listitem><listitem><para>
Texinfo node handling has been rewritten.  Node handling used to work
back and forth between IDs and node names, which caused a lot of
confusion.  The old code also could not support DocBook
<code>set</code>s because it did not keep track of the Texinfo
file being processed.  
</para><para>
As a consequence,  the bug in which <code>docbook2texixml</code> did
not output the <samp>@setinfofile</samp> is fixed.
<code>xreflabel</code> handling is also sane now.  
</para><para>
In the new scheme, elements are referred to by their ID (auto-generated
if necessary).  The Texinfo node names are generated before doing the
actual transformation, and subsequent <code>texinode_get</code>
simply looks up the node name when given an element.
</para></listitem><listitem><para>
The stylesheet architecture allows internationalization to be
implemented easily, although it is not done yet.
</para></listitem><listitem><para>
The (non-XML-based) old code is still in the CVS tree, but I’m not
really interested in maintaining it.  I’ll still accept patches to them, 
and probably will keep them around for reference and porting purposes.
</para><para>
There are some changes to the old code base in
this new release; see old change log for details.
</para></listitem><listitem><para>
The documentation has been revised.
</para></listitem><listitem><para>
I am currently rewriting docbook2man using the same transform-to-XML technique.
It’s not included in 0.5.9 simply because I wanted to get the improved
Texinfo tool out quickly.
Additional XSLT stylesheets will be written.
</para></listitem></itemize>

  </para><node id="design-notes" previousid="changes" nextid="install" upid="docbook2X"/><chapter>Design notes</chapter><indexterm class="cp">design</indexterm><indexterm class="cp">history</indexterm><para>
Lessons learned:

  <itemize markchar="&#x2022;"><listitem><indexterm class="cp">stream processing</indexterm><indexterm class="cp">tree processing</indexterm><para>
      Think four times before doing stream-based XML processing, even though it
      appears to be more efficient than tree-based.
      Stream-based processing is usually more difficult.
      </para><para>
      But if you have to do stream-based processing, make sure to use robust,
      fairly scaleable tools like <code>XML::Templates</code>, 
      <emph>not</emph> <code>sgmlspl</code>.  Of course it cannot 
      be as pleasant as tree-based XML processing, but examine 
      <code>db2x_manxml</code> and <code>db2x_texixml</code>.
      </para></listitem><listitem><para>
      Do not use <code>XML::DOM</code> directly for stylesheets.
      Your “stylesheet” would become seriously unmanageable.
      Its also extremely slow for anything but trivial documents.
      </para><para>
      At least take a look at some of the XPath modules out there.
      Better yet, see if your solution really cannot use XSLT.
      A C/C++-based implementation of XSLT can be fast enough
      for many tasks.
      </para></listitem><listitem><indexterm class="cp">XSLT extensions</indexterm><para>
      Avoid XSLT extensions whenever possible.  I don't think there is
      anything wrong with them intrinsically, but it is a headache
      to have to compile your own XSLT processor. (libxslt is written 
      in C, and the extensions must be compiled-in and cannot be loaded
      dynamically at runtime.)  Not to mention there seems to be a thousand
      different set-ups for different XSLT processors.
      </para></listitem><listitem><indexterm class="cp">Perl</indexterm><para>
      Perl is not as good at XML as it’s hyped to be.  
      </para><para>
      SAX comes from the Java world, and its port to Perl
      (with all the object-orientedness, and without adopting Perl idioms)
      is awkward to use.
      </para><para>
      Another problem is that Perl SAX does not seem to be well-maintained.
      The implementations have various bugs; while they can be worked around,
      they have been around for such a long time that it does not inspire
      confidence that the Perl XML modules are reliable software.
      </para><para>  
      It also seems that no one else has seriously used Perl SAX
      for robust applications.  It seems to be unnecessarily hard to 
      certain tasks such as displaying error diagnostics on its
      input, processing large documents with complicated structure.
      </para></listitem><listitem><indexterm class="cp">Man-XML</indexterm><indexterm class="cp">Texi-XML</indexterm><para>
      Do not be afraid to use XML intermediate formats 
      (e.g. Man-XML and Texi-XML) for converting to other
      markup languages, implemented with a scripting language.
      The syntax rules for these formats are made for 
      authoring by hand, not machine generation; hence a conversion
      using tools designed for XML-to-XML conversion, 
      requires jumping through hoops. 
      </para><para>
      You might think that we could, instead, make a separate module 
      that abstracts all this complexity
      from the rest of the conversion program.  For example,
      there is nothing stopping a XSLT processor from serializing
      the output document as a text document obeying the syntax
      rules for man pages or Texinfo documents.
      </para><para>
      Theoretically you would get the same result,
      but it is much harder to implement.  It is far easier to write plain 
      text manipulation code in a scripting language than in Java or C or XSLT.
      Also, if the intermediate format is hidden in a Java class or 
      C API, output errors are harder to see.
      Whereas with the intermediate-format approach, we can
      visually examine the textual output of the XSLT processor and fix
      the Perl script as we go along.
      </para><para>
      Some XSLT processors support scripting to go beyond XSLT
      functionality, but they are usually not portable, and not 
      always easy to use.
      Therefore, opt to do two-pass processing, with a standalone
      script as the second stage.  (The first stage using XSLT.)
      </para><para><anchor id="xslt-extensions-move"/>
      Finally, another advantage of using intermediate XML formats
      processed by a Perl script is that we can often eliminate the
      use of XSLT extensions.  In particular, all the way back when XSLT 
      stylesheets first went into docbook2X, the extensions related to
      Texinfo node handling could have been easily moved to the Perl script,
      but I didn't realize it!  I feel stupid now. 
      </para><para>
      If I had known this in the very beginning, it would have saved 
      a lot of development time, and docbook2X would be much more 
      advanced by now.
      </para><para>
      Note that even the man-pages stylesheet from the DocBook XSL
      distribution essentially does two-pass processing
      just the same as the docbook2X solution.  That stylesheet
      had formerly used one-pass processing, and its authors 
      probably finally realized what a mess that was.
      </para></listitem><listitem><para>
      Design the XML intermediate format to be easy to use from the standpoint
      of the conversion tool, and similar to how XML document types work in
      general.  e.g. abstract the paragraphs of a document, rather than their 
      paragraph <emph>breaks</emph>
      (the latter is typical of traditional markup languages, but not of XML).
      </para></listitem><listitem><para>
      I am quite impressed by some of the things that people make XSLT 1.0 do.
      Things that I thought were impossible, or at least unworkable
      without using “real” scripting language. 
      (<code>db2x_manxml</code> and <code>db2x_texixml</code> fall in the
      category of things that can be done in XSLT 1.0 but inelegantly.)
      </para></listitem><listitem><para>
      Internationalize as soon as possible.  
      That is much easier than adding it in later.
      </para><para>
      Same advice for build system.
      </para></listitem><listitem><para>
        I would suggest against using build systems based
        on Makefiles or any form of automake.
        Of course it is inertia that prevents people from
        switching to better build systems.  But also
        consider that while Makefile-based build systems 
        can do many of the things newer build systems are capable
        of, they often require too many fragile hacks.  Developing
        these hacks take too much time that would be better
        spent developing the program itself.
      </para><para>
        Alas, better build systems such as scons were not available
        when docbook2X was at an earlier stage.  It’s too late
        to switch now.
      </para></listitem><listitem><para>
      Writing good documentation takes skill.  This manual has
      has been revised substantially at least four times
      <footnote>
      This number is probably inflated because of the so many design 
      mistakes in the process.</footnote>, with the author
      consciously trying to condense information each time.
      </para></listitem><listitem><para>
        Table processing in the pure-XSLT man-pages conversion
        is convoluted — it goes through HTML(!) tables as an intermediary.
        That is the same way that the DocBook XSL stylesheets implement
        it (due to Michael Smith), and I copied the code there
        almost verbatim.  I did it this way to save myself time and energy
        re-implementing tables conversion <emph>again</emph>.
      </para><para>
        And Michael Smith says that going through HTML is better,
        because some varieties of DocBook allow the HTML table model
        in addition to the CALS table model.  (I am not convinced
        that this is such a good idea, but anyway.)
        Then HTML tables in DocBook can be translated to man pages
        too without much more effort.
      </para><para>
        Is this inefficient? Probably.  But that’s what you get
        if you insist on using pure XSLT.  The Perl implementation
        of docbook2X.
        already supported tables conversion for two years prior.
      </para></listitem><listitem><para>
        The design of <code>utf8trans</code> is not the best.
        It was chosen to simplify implementations while being efficient.
        A more general design, while still retaining efficiency, is possible, 
        which I describe below.  However, unfortunately,
        at this point changing <code>utf8trans</code>
        will be too disruptive to users with little gain in functionality.
      </para><para>
        Instead of working with characters, we should work with byte strings.
        This means that, if all input and output is in UTF-8,
        with no escape sequences, then UTF-8 decoding or encoding
        is not necessary at all.  Indeed the program becomes agnostic
        to the character set used.  Of course,
        multi-character matches become possible.
      </para><para>
        The translation map will be an unordered list of key-value pairs.
        The key and value are both arbitrary-length byte strings,
        with an explicit length attached (so null bytes in the input
        and output are retained).
      </para><para>
        The program would take the translation map, and transform the input file
        by matching the start of input, seen as a sequence of bytes, 
        against the keys in the translation map, greedily.
        (Since the matching is greedy, the translation keys do not
        need to be restricted to be prefix-free.)
        Once the longest (in byte length) matching key is found, 
        the corresponding value (another byte string) is substituted
        in the output, and processing repeats (until the input is finished).
        If, on the other hand, no match is found, the next byte
        in the input file is copied as-is, and processing repeats 
        at the next byte of input.
      </para><para>
        Since bytes are 8 bits and the key strings are typically
        very short (up to 3 
        bytes for a Unicode BMP character encoded in UTF-8),
        this algorithm can be implemented with radix search.
        It would be competitive, in both execution time and space,
        with character codepoint hashing and sparse multi-level
        arrays, the primary techniques for implementing
        Unicode <emph>character</emph> translation.
        (<code>utf8trans</code> is implemented using sparse multi-level arrays.)
      </para><para>
        One could even try to generalize the radix searching further,
        so that keys can include wildcard characters, for example.
        Taken to the extremes, the design would end up being
        a regular expressions processor optimized for matching
        many strings with common prefixes.
      </para></listitem></itemize>
  
</para><node id="install" previousid="design-notes" nextid="cindex" upid="docbook2X"/><appendix>Package installation</appendix><menu><menuentry idref="install-procedure"><menuentrytitle>Installation</menuentrytitle><menuentrydescrip>Package install procedure</menuentrydescrip></menuentry><menuentry idref="dependencies"><menuentrytitle>Dependencies on other software</menuentrytitle><menuentrydescrip>Other software packages that docbook2X needs</menuentrydescrip></menuentry></menu><node id="install-procedure" nextid="dependencies" upid="install"/><section>Installation</section><indexterm class="cp">docbook2X package</indexterm><indexterm class="cp">installation</indexterm><para>
After checking that you have the 
necessary prerequisites (<pxref idref="dependencies"/>),
unpack the tarball, then run <samp>./configure</samp>, and
then <samp>make</samp>, <samp>make install</samp>,
as usual.  </para><quotation><para><strong>Note</strong></para><para>
<indexterm class="cp">pure XSLT</indexterm>
If you intend to use only the pure XSLT version of docbook2X,
then you do not need to compile or build the package at all.
Simply unpack the tarball, and point your XSLT processor
to the XSLT stylesheets under the <file>xslt/</file>
subdirectory.
</para></quotation><para>
(The last <samp>make install</samp> step, to install
the files of the package onto the filesystem, is optional.  You may use
docbook2X from its own directory after building it, although in that case, 
when invoking docbook2X, you will have to specify some paths manually
on the command-line.)
</para><para>
You may also want to run <samp>make check</samp> to do some
checks that the package is working properly.  Typing
<samp>make -W docbook2X.xml man texi</samp> in
the <file>doc/</file> directory will rebuild
docbook2X’s own documentation, and can serve as an additional check.
</para><para>
You need GNU make to build docbook2X properly.
</para><indexterm class="cp">CVS</indexterm><para>
If you are using the CVS version, you will also need the autoconf and automake
tools, and must run <samp>./autogen.sh</samp> first.  But
see also the note below about the CVS version.
</para><para>
<indexterm class="cp">HTML documentation</indexterm>
If you want to (re-)build HTML documentation (after having installed Norman Walsh’s DocBook XSL stylesheets), pass <code>--with-html-xsl</code>
to <samp>./configure</samp>.  You do not really need this,
since docbook2X releases already contain pre-built HTML documentation.
</para><para>
Some other packages also call their conversion programs
<code>docbook2man</code> and <code>docbook2texi</code>;
you can use the <code>--program-transform-name</code> parameter to 
<samp>./configure</samp> if you do not want docbook2X to clobber
over your existing <code>docbook2man</code> or 
<code>docbook2texi</code>.
</para><para>
If you are using a Java-based XSLT processor,
you need to use pass <code>--with-xslt-processor=saxon</code> for
SAXON, or <code>--with-xslt-processor=xalan-j</code> for
Xalan-Java.  (The default is for libxslt.)
In addition, since the automatic check for the installed JARs is not
very intelligent, you will probably need to pass some options
to <samp>./configure</samp> to tell it where the JARs are.
See <samp>./configure --help</samp> for details.
</para><para>
The docbook2X package supports VPATH builds (building in a location 
other than the source directory), but any newly generated documentation
will not end up in the right place for installation and redistribution.
Cross compilation is not supported at all.
</para><anchor id="install-problems"/><subsection>Installation problems</subsection><indexterm class="cp">problems</indexterm><varlist><varlistentry><term>  Q:</term><listitem><para>Where is <code>XML::Handler::SGMLSpl</code>?</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
It’s included in the docbook2X package.  
If Perl says it cannot find it,
then that is a bug in the docbook2X distribution.
Please report it.
</para><para>
In older versions of docbook2X, the SGMLSpl module
had to be installed, or specified manually on the Perl command line.
That is no longer the case.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
<code>db2x_xsltproc</code> tells me that ‘one input document is required’
when building docbook2X.
</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
Use GNU make to build docbook2X (as opposed to BSD make).
</para><para>
I could fix this incompatibility in the docbook2X make files,
but some of the default automake rules have the same problem,
so I didn’t bother.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>
When docbook2X attempts to build its documentation,
I get errors about “attempting to load network entity”, etc.
</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
You will need to set up the XML catalogs for the DocBook XML DTDs correctly.
This tells the XSLT processor where to find the DocBook DTDs on your system.
Recent Linux distributions should already have this done for you.
</para><para>
This error (or rather, warning) is harmless in the case of docbook2X
documentation — it does not actually require the DTD to build.
But your other DocBook documents might (mainly because they use
the ISO entities).
</para><para>
libxml also understands SGML catalogs, but last time I tried it
there was some bug that stopped it from working.  Your Mileage May Vary.
</para></listitem></varlistentry><varlistentry><term>  Q:</term><listitem><para>I cannot build from CVS.</para></listitem></varlistentry><varlistentry><term>  A:</term><listitem><para>
If the problem is related to HTML files, then you must
pass <code>--with-html-xsl</code> to <code>configure</code>.
The problem is that the HTML files are automatically generated
from the XML source and are not in CVS, but the Makefile still
tries to install them.  (This issue does not appear when
building from release tarballs.)
</para></listitem></varlistentry></varlist><para>
For other docbook2X problems, please also look at its main documentation.
</para><node id="dependencies" previousid="install-procedure" upid="install"/><section>Dependencies on other software</section><indexterm class="cp">dependencies</indexterm><indexterm class="cp">prerequisites</indexterm><indexterm class="cp">docbook2X package</indexterm><para>
    To use docbook2X you need:

    <varlist><varlistentry><term>A reasonable Unix system, with Perl 5</term><listitem><indexterm class="cp">Windows</indexterm><para>
            docbook2X can work on Linux, FreeBSD, Solaris, and Cygwin on Windows.
          </para><para>
            A C compiler is required to compile
            a small ANSI C program (<code>utf8trans</code>).  
          </para></listitem></varlistentry><varlistentry><term>XML-NamespaceSupport, XML-SAX, XML-Parser and
XML-SAX-Expat (Perl modules)</term><listitem><para>
<indexterm class="cp">Perl</indexterm>
            The last two are optional: they add a Perl interface to the 
            C-based XML parser Expat.  It is recommended that you install them 
            anyway; otherwise, the fallback Perl-based XML parser
            makes docbook2X real slow.
          </para><para>
            You can get all the Perl modules here: <uref url="http://www.cpan.org/modules/by-category/11_String_Lang_Text_Proc/XML/">CPAN XML module listing</uref>.
          </para></listitem></varlistentry><varlistentry><term>iconv</term><listitem><indexterm class="cp"><code>iconv</code></indexterm><para>
            If you are running Linux glibc, you already have it.
            Otherwise, see <uref url="http://www.gnu.org/software/libiconv/">the GNU libiconv home page</uref>.
          </para></listitem></varlistentry><varlistentry><term>XSLT 1.0 processor</term><listitem><para>
<indexterm class="cp">SAXON</indexterm>
<indexterm class="cp">Xalan-Java</indexterm>
<indexterm class="cp">libxslt</indexterm>
            You have a choice of:
            
            <varlist><varlistentry><term>libxslt</term><listitem><para>See the <uref url="http://xmlsoft.org/">
                        libxml2, libxslt home page</uref>.</para></listitem></varlistentry><varlistentry><term>SAXON</term><listitem><para>See <uref url="http://saxon.sourceforge.net/">
                        the SAXON home page</uref>.</para></listitem></varlistentry><varlistentry><term>Xalan-Java</term><listitem><para>See <uref url="http://xml.apache.org/xalan-j/">
                        the Xalan-Java home page</uref>.</para></listitem></varlistentry></varlist>
          </para><para>
<indexterm class="cp">catalog</indexterm>
            For the Java-based processors (SAXON and Xalan-Java),
            you will also need<footnote>Strictly speaking this component is not required, but if you do not have it, you will almost certainly have your computer downloading large XML files from the Internet all the time, as portable XML files will not refer directly to cached local copies of the required files.</footnote> <uref url="http://xml.apache.org/commons/">the Apache 
            XML Commons</uref> distribution.
            This adds XML catalogs support to any Java-based 
            processor.
          </para><para>
            Out of the three processors, libxslt is recommended.
            (I would have added support for other XSLT processors,
            but only these three seem to have proper XML catalogs
            support.)
          </para><para>
            Unlike previous versions of docbook2X, these Java-based
            processors can work almost out-of-the-box.  Also docbook2X
            no longer needs to compile XSLT extensions,
            so you if you use an OS distribution package of libxslt,
            you do not need the development versions of the
            library any more.
          </para></listitem></varlistentry><varlistentry><term>DocBook XML DTD</term><listitem><indexterm class="cp">DocBook</indexterm><para>
            Make sure you set up the XML catalogs for the DTDs
            you install.
          </para><para>The <uref url="http://www.docbook.org/"><i>DocBook: The Definitive Guide</i> website</uref> has more information.
          </para><para>You may also need the SGML DTD if your documents are SGML
          rather than XML.</para></listitem></varlistentry><varlistentry><term>Norman Walsh’s DocBook XSL stylesheets</term><listitem><indexterm class="cp">HTML documentation</indexterm><para>See the <uref url="http://docbook.sourceforge.net/">Open DocBook Repository</uref>.</para><para>
            This is optional and is only used to build documentation in HTML format.  In your XML catalog, point the URI in <file>doc/ss-html.xsl</file>
            to a local copy of the stylesheets.
          </para></listitem></varlistentry></varlist>
  </para><para>
    For all the items above, it will be easier for you
    to install the OS packaging of the software (e.g. Debian packages),
    than to install them manually.  But be aware that sometimes the OS
    package may not be for an up-to-date version of the software.
  </para><indexterm class="cp">Windows</indexterm><para>
    If you cannot satisfy all the prerequisites above (say you are on 
    a vanilla Win32 system), then you will not be able to “build”
    docbook2X properly, but if you are knowledgeable, you can still
    salvage its parts (e.g. the XSLT stylesheets, which can be run alone).
  </para><node id="cindex" previousid="install" upid="docbook2X"/><unnumbered>Index</unnumbered><printindex class="cp"/><documentlanguage/></texinfo></texinfoset>