[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- From: Jeni Tennison <firstname.lastname@example.org>
- To: Adnan Zelkanovic <email@example.com>
- Date: Fri, 17 Aug 2001 10:10:09 +0100
XSLT questions are best address to XSL-List at
> i'm trying to set the start value number 2 with xsl:number, but it
> don't work.
> Is the syntax [<xsl:number level="any" from="2" format="1"/>] wrong.
Yes, the syntax is wrong. The from attribute needs to take a pattern -
it looks for the closest node matching that pattern and numbers nodes
starting from that one.
You have to count the nodes yourself to do that, although you can
still use xsl:number's number formatting facilities. I think you
probably need something like:
<xsl:number value="count(preceding::foo | ancestor::foo) + 2"
You should replace 'foo' with the name of the elements you're
numbering (assuming they're elements, or a node test for the nodes
you're numbering if they're not elements). Preferably you should
replace the path with something that's more specific - for example,
take out the count of ancestors unless you need to count ancestors.
- From: Adnan Zelkanovic <firstname.lastname@example.org>