view doc/wiki2docbook/html2db/ar01s08.html @ 1811:f405ec9b696b default tip

Some small logic mistakes Use boolean operators for booleans and bitwise otherwise only.
author mow
date Mon, 10 May 2010 11:33:13 +0000
parents 2ae81598b254
children
line wrap: on
line source

<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Customization</title><meta content="DocBook XSL Stylesheets V1.65.1" name="generator"><link rel="home" href="index.html" title="html2db.xsl"><link rel="up" href="index.html" title="html2db.xsl"><link rel="previous" href="ar01s07.html" title="Specification"><link rel="next" href="ar01s09.html" title="FAQ"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">Customization</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="ar01s07.html">Prev</a>&nbsp;</td><th align="center" width="60%">&nbsp;</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="ar01s09.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="customization"></a>Customization</h2></div></div><div></div></div><p></p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="N102C9"></a>XSLT Parameters</h3></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term"><tt class="literal">&lt;xsl:param name="anchor-id-prefix" select="''/&gt;</tt></span></dt><dd><p>Prefixed to every id generated from <tt class="literal">&lt;a name=&gt;</tt>
  and <tt class="literal">&lt;a href="#"&gt;</tt>.  This is useful to avoid
  collisions between multiple documents that are compiled into the
  same book.  For instance, if a number of XHTML sources are assembled
  into chapters of a book, you style each source file with a prefix of
  <tt class="literal"><i class="replaceable"><tt>docid</tt></i>.</tt> where <i class="replaceable"><tt>docid</tt></i> is a unique id
  for each source file.</p></dd><dt><span class="term"><tt class="literal">&lt;xsl:param name="document-root" select="'article'"/&gt;</tt></span></dt><dd><p>The default document root.  This can be overridden by
  <tt class="literal">&lt;?html2db class="<i class="replaceable"><tt>name</tt></i>"&gt;</tt> within the
  document itself, and defaults to <tt class="literal">article</tt>.</p></dd></dl></div><p></p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="processing-instructions"></a>Processing instructions</h3></div></div><div></div></div><p>Use the <tt class="literal">&lt;?html2db?&gt;</tt> processing instruction to
customize the transformation of the XHTML source to Docbook:</p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Processing instruction</th><th>Content</th><th>Effect</th></tr></thead><tbody><tr><td><tt class="literal">&lt;?html2db class="<i class="replaceable"><tt>xxx</tt></i>"?&gt;</tt></td><td><tt class="literal">body</tt></td><td>Sets the output document root to <i class="replaceable"><tt>xxx</tt></i>.  Useful for
translating to <tt class="literal">prefix</tt>, <tt class="literal">appendix</tt>, or <tt class="literal">chapter</tt>; the default is
<i class="replaceable"><tt>$document-root</tt></i>.</td></tr><tr><td><a name="simplelist"></a><tt class="literal">&lt;?html2db class="simplelist"?&gt;</tt></td><td><tt class="literal">ul</tt></td><td>Creates a vertical <tt class="literal">simplelist</tt>.<sup>[<a href="#ftn.N10330" name="N10330">a</a>]</sup></td></tr><tr><td><tt class="literal">&lt;?html2db rowsep="1"?&gt;</tt></td><td><tt class="literal">[informal]table</tt></td><td>Sets the <tt class="literal">rowsep</tt> attribute on the generated <tt class="literal">table</tt>.<sup>[<a href="#ftn.N10349" name="N10349">b</a>]</sup></td></tr></tbody><tbody class="footnotes"><tr><td colspan="3"><div class="footnote"><p><sup>[<a href="#N10330" name="ftn.N10330">a</a>] </sup>Note that the
current implementation simply checks for the presence of <span class="em">any</span>
<tt class="literal">html2db</tt> processing instruction.</p></div><div class="footnote"><p><sup>[<a href="#N10349" name="ftn.N10349">b</a>] </sup>Note that the current implementation simply checks for the presence of <span class="em">any</span> <tt class="literal">html2db</tt> processing instruction that begins with <tt class="literal">rowsep</tt>, and assumes the vlaue is <tt class="literal">1</tt>.</p></div></td></tr></tbody></table></div><p></p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="embedding"></a>Overriding the built-in templates</h3></div></div><div></div></div><p>For cases where the previous techniques don't allow for enough
customization, you can override the builtin templates.  You will need
to know XSLT in order to do this, and you will need to write a new
stylesheet that uses the <tt class="literal">xsl:import</tt> element to import
<tt class="literal">html2db.xsl</tt>.</p><p>The <a href="examples.xsl" target="_top"><tt class="literal">example.xsl</tt></a> stylesheet
is an example customization layer.  It recognizes the <tt class="literal">&lt;div
class="abstract"&gt;</tt> and <tt class="literal">&lt;p class="note"&gt;</tt>
classes in the <a href="index.src.html" target="_top">source</a> for this document,
and generates the corresponding Docbook elements.</p><p></p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="ar01s07.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="index.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="ar01s09.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">Specification&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;FAQ</td></tr></table></div></body></html>