forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Schaub" <ssch...@bju.edu>
Subject Generating TOC for Aggregate PDF's
Date Tue, 14 Sep 2004 19:15:05 GMT
More on generating PDF's from a selected set of documents using the
howto-pdf-tab:

The TOC in the PDF generated using this approach has a single top-level
entry. I edited the book2cinclude.xsl file to filter out the top-level entry
by replacing the following:

  <xsl:template match="menu[not(contains(@href, '.'))]">
    <section>
      <title><xsl:value-of select="@label"/></title>
      <xsl:apply-templates/>
    </section>
  </xsl:template>

with this:

  <xsl:template match="menu[not(contains(@href, '.'))]">
    <xsl:choose>
      <xsl:when test="name(..) = 'book' and count(../*) = 1" >
        <xsl:apply-templates/>
      </xsl:when>
      <xsl:otherwise>
        <section>
          <title><xsl:value-of select="@label"/></title>
          <xsl:apply-templates/>
        </section>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

In my tests, this effectively filters out the single top-level entry.


Stephen Schaub


Mime
View raw message