|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: parameter count in xsl:number
Paul,
>I'm trying to pass an element as parameter for a named template, to be used
>in a xsl:number expression. I use it like this :
>
> <xsl:number level="any"
> format="_1"
> count="$element"/>
>
>My processor (Oracle) is complaining that there is an error in the
>expression. If I try name($element) or string($element), same thing. Any
>idea what kind of expression it expects ?
The 'count' attribute on xsl:number expects a pattern that matches the
nodes you're interested in counting to make up the number. So something like:
<xsl:number level="any" format="1." count="footnote" />
would give the number of 'footnote' elements appearing before the current
node in the document, including the current node if it's a 'footnote'
element itself.
You can't use a parameter for the 'count' attribute, so you're probably
stuck doing something like:
<xsl:choose>
<xsl:when test="$element = 'type1'">
<xsl:number level="any" format="_1" count="type1" />
</xsl:when>
<xsl:when test="$element = 'type2'">
<xsl:number level="any" format="_1" count="type2" />
</xsl:when>
</xsl:choose>
and so on, although another solution may be apparent if you give more
details about what you're trying to achieve.
Sorry not to be more help,
Jeni
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








