Subject: [xsl] Accessing node-sets by index with position() From: Ryan Sawatzky <rsawatzky@xxxxxxxxxxx> Date: Tue, 23 Sep 2003 14:13:16 -0500 |
<info> <field>111</field> <field>222</field> </info>
XSLT snippet ----- <!-- $set is the node-set containing the two <field> elements -->
<xsl:for-each select="$set"> <xsl:text>Iteration #</xsl:text> <xsl:value-of select="position()"/> <xsl:text> is '</xsl:text> <xsl:value-of select="$set[position()]"/> <xsl:text>' </xsl:text> </xsl:for-each>
This gives the following output Iteration #1 is 111 Iteration #2 is 111
Iteration #1 is 222 Iteration #2 is 222
Thanks, --Ryan
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] document function support, Michael Kay | Thread | Re: [xsl] Accessing node-sets by in, G. Ken Holman |
RE: [xsl] Using variables to determ, Paulo Gleich | Date | [xsl] Assigning Values to Global Pa, James Paul |
Month |