Brian Trezise wrote:
Can somebody point me to a good (and well explained) example of using XSL/FOP to auto-create a table of contents? I’ve spent the last couple hours looking for information on this but it’s not making sense.

Here’s a sample of my xml:
<?xml version="1.0" encoding="UTF-8"?>

<catalog>

  <intellispec>

    <pn>C0805C101J1GACTU</pn>

    <aliases>

      <alias>C0805C101J1GAC7800</alias>

    </aliases>

    <mfg>KEMET</mfg>

    <svg-path>C:/svn/code/IntelliSpec/images/</svg-path>

    <copyright-year>2006-2009</copyright-year>

      . . .

  </intellispec>

  <intellispec>

    <pn>T491B107K010AT</pn>

    <mfg>KEMET</mfg>

    <svg-path>C:/svn/code/IntelliSpec/images/</svg-path>

    <copyright-year>2006-2009</copyright-year>

      . . .

  </intellispec>

      . . .

I would like to generate a table of contents page using the text of the catalog/intellispec/pn and mfg tags (the table of contents would render more or less as follows:

C0805C101J1GACTU (KEMET) ..................... 1

T491B107K010AT (KEMET) ....................... 2

      . . .

(Each item would also have an internal hyperlink to the page number in the pdf where the associated datasheet is located)

Perhaps this can help as an example: http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/resources/xhtml2fo.xsl

Look for <!-- Table of content --> to find the code that generates the table of contents, and then search for
<xsl:template match="html:h1" mode="transform">
to see how to generate the link target.


--
Sergiu Dumitriu
http://purl.org/net/sergiu/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to