xsl-list
[Top] [All Lists]

Re: minor grouping issue

2005-05-07 15:47:06

On May 7, 2005, at 10:58 AM, Michael Kay wrote:

It's probably simplest to put the xsl:number within an xsl:choose to
distinguish the two cases.

Since the same number gets used in two places (footnote mark in text mode, and footnote-list mode), I thought I'd create a function. So I have:

  <xsl:function name="db:number-footnote" as="xs:string">
    <xsl:param name="footnote" as="element(db:footnote)"/>
    <xsl:choose>
      <xsl:when test="$chapters/db:chapter">
        <xsl:number level="any" count="$footnote" from="db:chapter"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:number level="any" count="$footnote"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:function>

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

However, I'm getting this error:

F XPath syntax error at char 0 in {$footnote}:
    Unexpected token in pattern, found "$"

Why?  And how can I fix it?

Bruce


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>