[XSL-LIST Mailing List Archive Home]
[xsl] Current node position
Subject: [xsl] Current node position|
From: jwhitney <jwhitney@xxxxxx>
Date: Wed, 11 Jun 2003 15:55:11 -0300
I'm trying to generate html code for "Date 1 of 2", "Date 2 of 2", etc., from
XML as below:
from within a template that matches "d". The following stylesheet fragment:
<xsl:value-of select="position()" />
<xsl:text> of </xsl:text>
<xsl:value-of select="count(../date)" />
produces "3 of 2" and "4 of 2". Is there a way to restrict position() to
evaluate the <date> nodes only? How else could it be done?
I'm new to XSLT, obviously. Thanks in advance for any help with this.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list