1. The value of position() within an xsl:template depends on the position of
the node within the set of nodes selected by the select expression of the
corresponding xsl:apply-templates, which you haven't shown us.
2. You don't say what numbering you would consider correct. If you're
looking for multi-level numbering, try <xsl:number level="multiple"/>. If
you want single-level numbering, consider <xsl:number level="any"/>.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Sven Waibel [mailto:sven(_dot_)waibel(_at_)imbus(_dot_)de]
Sent: 10 January 2007 10:41
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Numbering: position() ?
Hi,
i got following xml:
<book id="1">
<page>
<special>
<page>
<page>
</special>
<page>
<page>
</book>
xslt:
<xsl:template match="page">
<xsl:value-of select="concat(concat(ancestor::book/$id,
'.'), position())"/> </xsl:template>
I got this numbering:
1.1
1.1
1.2
1.3
1.4
How can i achieve that the numbering is correct?
Thanks
Sven
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--