|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: problem with xsl:number
Hi Bryan,
> <xsl:number> would give you the position of the element in the source
> tree. Try giving a node value to the count attribute..
> <xsl:number count = "node you wana count"/>
> thanks I'll try that.
> althought I thought as a default it counted the current node?
It does - more importantly, by default it counts at a level of
'single', so it gives you the position of the current node amongst
other nodes of that type (and name) in the same parent. So if you
have:
<ol>
<li>option 1</li>
<li>option 2</li>
...
</ol>
and then match li elements and number them:
<xsl:template match="li">
<xsl:number format="1. " />
<xsl:value-of select="." />
</xsl:template>
then you get the correct numbering of 1 through to however many items
there are in the list.
You seem to want to number images across the *entire document* rather
than within the parent element. If so, you should use the level
attributeof xsl:number with a value of 'any', to say that you want to
count the image amongst other images in the document rather than just
its parent:
<xsl:template match="image">
<xsl:number level="any" />
...
</xsl:template>
Cheers,
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








