Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 0577d24a2237617ff09bd0e03e449a74 > files > 150

docbook-style-xsl-doc-1.60.1-2mdk.noarch.rpm

<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>make.index.markup</title><link rel="stylesheet" href="../ref.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.0"><link rel="home" href="index.html" title="FO Parameter Reference"><link rel="up" href="rn03.html" title="ToC/LoT/Index Generation"><link rel="previous" href="generate.index.html" title="generate.index"><link rel="next" href="toc.section.depth.html" title="toc.section.depth"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">make.index.markup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="generate.index.html">Prev</a>&nbsp;</td><th width="60%" align="center">ToC/LoT/Index Generation</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="toc.section.depth.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="make.index.markup"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>Name</h2><p>make.index.markup &#8212; Generate XML index markup in the index?</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><a name="make.index.markup.frag"></a><table border="1" width="100%"><tr><td><p><b>&sect;21</b>: <a href="#top">&sect;199</a></p></td></tr><tr><td><pre class="src:fragment">&nbsp;&nbsp;1| &lt;xsl:param name="make.index.markup"
&nbsp;&nbsp;2|            select="0"/&gt;</pre></td></tr></table></div><div class="refsect1" lang="en"><h2>Description</h2><p>This parameter enables a very neat trick for getting properly
merged, collated back-of-the-book indexes. G. Ken Holman suggested
this trick at Extreme Markup Languages 2002 and I'm indebted to him
for it.</p><p>Jeni Tennison's excellent code in
<tt class="filename">autoidx.xsl</tt> does a great job of merging and
sorting <a href="http://docbook.org/tdg/en/html/indexterm.html"><tt class="sgmltag-element">indexterm</tt></a>s in the document and building a
back-of-the-book index. However, there's one thing that it cannot
reasonably be expected to do: merge page numbers into ranges. (I would
not have thought that it could collate and suppress duplicate page
numbers, but in fact it appears to manage that task somehow.)</p><p>Ken's trick is to produce a document in which the index at the
back of the book is &#8220;<span class="quote">displayed</span>&#8221; in XML. Because the index
is generated by the FO processor, all of the page numbers have been resolved.
It's a bit hard to explain, but what it boils down to is that instead of having
an index at the back of the book that looks like this:</p><div class="blockquote"><blockquote class="blockquote"><p><b>A.&nbsp;</b>ap1, 1, 2, 3</p></blockquote></div><p>you get one that looks like this:</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">&lt;indexdiv&gt;A&lt;/indexdiv&gt;
&lt;indexentry&gt;
&lt;primaryie&gt;ap1&lt;/primaryie&gt;,
&lt;phrase role="pageno"&gt;1&lt;/phrase&gt;,
&lt;phrase role="pageno"&gt;2&lt;/phrase&gt;,
&lt;phrase role="pageno"&gt;3&lt;/phrase&gt;
&lt;/indexentry&gt;</pre></blockquote></div><p>After building a PDF file with this sort of odd-looking index, you can
extract the text from the PDF file and the result is a proper index expressed in
XML.</p><p>Now you have data that's amenable to processing and a simple Perl script
(such as <tt class="filename">fo/pdf2index</tt>) can
merge page ranges and generate a proper index.</p><p>Finally, reformat your original document using this literal index instead of
an automatically generated one and &#8220;<span class="quote">bingo</span>&#8221;!</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="generate.index.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="rn03.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="toc.section.depth.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">generate.index&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;toc.section.depth</td></tr></table></div></body></html>