Hi,
I have a problem with numbering through XSLT. My first approach, something like
Code:
<xsl:number level="any" format="1. " from="nliste[@reset='reset']" count="nliste"/>
failed as the different XSLT-interpreters behave differently on the first element. E.g., Xalan starts with 1, Xerces with nothing and whatever is used by Firefox with 0 oder vice versa. As it was only used to create FO code for Apache FOP, I could live with a custom FOP version on our server.
Now, I create HTML from the very same XML to be presented on the clients browsers, so I have to figure out a different way for numbered lists without changing the DTD.
I came up with
Code:
<xsl:value-of select="count(preceding-sibling::nliste)+1"/>
what works perfectly on Firefox and IE (it stops counting on a preceding sibling that's not the element in focus. However, Epiphany on a Raspberry Pi failed miserably by numbering all nliste-siblings, no matter if there is a different element between them.
My question: What's right, what's wrong, and what is a good approach on numbering. I know my nliste element was never a good idea, but it's quite late to change that.
TIA
Thomas
Edit: Now that I've written it down, I see I'm in error. All parsers count all siblings. Sorry :-(.