simonchristieis
Programmer
when I use a key:
Code:
<root>
<node>
<name>foo</name>
</node>
<node>
<name>bar</name>
</node>
</root>
Code:
<xsl:key name="bob" match="node[contains(name,'foo')]" use="name"/>
<xsl:apply-templates select="root/node[count(.|key('bob',name)[1])=1]" mode="test"/>
<xsl:template match="node" mode="test">
<xsl:value-of select="."/>
</xsl:template>
This prints out both foo and bar, can anyone explain why ?