[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: minor grouping issue

Subject: RE: minor grouping issue
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 7 May 2005 23:59:05 +0100
re minor
The count attribute must be an XSLT pattern, $footnote is not a pattern.

You'll get another error here, which is that there is no context node inside
a function. You need to add

select="$footnote" 

to indicate which node you want to be numbered.

The count attribute indicates which nodes should be counted. For example, if
you want to number figures and equations in the same numbering sequence, you
write count="figure|equation". By default, you count nodes of the same name
as the one you are numbering, so you can probably just omit this attribute.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Bruce D'Arcus [mailto:bdarcus@xxxxxxxxx] 
> Sent: 07 May 2005 23:47
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  minor grouping issue
> 
> 
> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.