[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] value and/or type of node()


Subject: Re: [xsl] value and/or type of node()
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 17 Jul 2009 19:47:54 +0200

Dick Penny wrote:

<xsl:template name="oneCell" >
	<td>
    <xsl:variable name="v1" select="node()"/>
OK	<xsl:value-of select="count($Rows[@GroupAssigned=$v1])"/>
BAD     <xsl:value-of select="count($Rows[@GroupAssigned=node()])"/>
	</td>
</xsl:template>

Which is called inside of a for-each loop, doing "pull" style processing.

Why does one work and not the other? What do I not understand?

You would need
<xsl:value-of select="count($Rows[@GroupAssigned=current()/node()])"/>
otherwise, with the way you have it, the node() in the predicate is relative to each node in $Rows.



--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/


Current Thread