Subject: [xsl] current() within a key element's @use From: "John P. McCaskey" <groups@xxxxxxxxxxxxxxxx> Date: Sun, 23 Dec 2012 19:24:59 -0500 |
Shouldn't these <xsl:key name="keyUsingCurrent" match="color" use="current()/@id"/> <xsl:key name="keyWithoutCurrent" match="color" use="@id"/> produce the same set of keys?
With this XML <t> <color id="b">blue</color> <color id="r">red</color> </t>
<xsl:key name="keyUsingCurrent" match="color" use="current()/@id"/> <xsl:key name="keyWithoutCurrent" match="color" use="@id"/>
<xsl:template match="/"> (1):<xsl:value-of select="key('keyUsingCurrent', 'b')"/> (2):<xsl:value-of select="key('keyUsingCurrent', 'r')"/>
(1):<xsl:value-of select="key('keyWithoutCurrent', 'b')"/> (2):<xsl:value-of select="key('keyWithoutCurrent', 'r')"/> </xsl:template>
(1):blue (2):red
(1):blue (2):red
(1): (2):
(1):blue (2):red
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[no subject], Unknown | Thread | [xsl] If/then/else confusion, Mark Wilson |
[no subject], Unknown | Date | [xsl] If/then/else confusion, Mark Wilson |
Month |