xslt get node-set text with key function



Is it possible to access the textnode of a node-set with a key function in xslt 1.0? I have following code:



<xsl:variable name="Items">
<Item ID="ID1">name1</Item>
<Item ID="ID2">name2</Item>
</xsl:variable>

<xsl:key name="get_item_by_ID" match="exsl:node-set($Items)/Item" use="@ID"/>

<xsl:template match="/Items">
<xsl:value-of select="key('get_item_by_ID', @ItemID)/text()"></xsl:value-of>
</xsl:template>


I want to search for the text of the node-set by the ItemID of the current Item, in order to rename the Item by it's predefined node-set text (ID1: name1, ID2: name2).


No comments:

Post a Comment