|
Subject: Re: [xsl] problem with xsl:number From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Wed, 27 Mar 2002 13:28:44 +0000 |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] msxsl.exe doesn't show xsl:me, Bryan Rasmussen | Thread | RE: [xsl] problem with xsl:number, Bryan Rasmussen |
| [xsl] msxsl.exe doesn't show xsl:me, Bryan Rasmussen | Date | RE: [xsl] Fixing &lt;b&gt;, tammy |
| Month |