Re: [xsl] minor grouping issue

Subject: Re: [xsl] minor grouping issue
From: Bruce D'Arcus <bdarcus@xxxxxxxxx>
Date: Sat, 7 May 2005 08:25:10 -0400
On May 6, 2005, at 6:03 PM, Michael Kay wrote:

I don't know why each group contains all the notes for the entire book, but
I suspect it's an error in the template that gets invoked by the
apply-templates call that you've shown us.

OK, I now have this:


<xsl:for-each select="$chapters/db:chapter">
   <h3>Chapter <xsl:value-of select="@label"/></h3>
   <xsl:apply-templates select="//db:footnote" mode="footnote-list"/>
</xsl:for-each>

... which applies this template:

  <xsl:template match="db:footnote" mode="footnote-list">
    <xsl:variable name="incr">
      <xsl:number level="any" count="db:footnote"/>
    </xsl:variable>
    <p id="fn{$incr}">
      <a href="#fnm{$incr}" class="footnote-anchor">
        <xsl:value-of select="$incr"/>
      </a>
      <xsl:text>. &#xa0;</xsl:text>
      <xsl:apply-templates/>
    </p>
  </xsl:template>

The solution to the all-footnotes-repeated-in-each-chapter was to select ".//db:footnote" instead of "//db:footnote".

However, the xsl:number element is still counting footnotes throughout the whole document. How would I modify that to only count in the chapter?

Bruce

Current Thread