summaryrefslogtreecommitdiff
path: root/tests/exslt/common/node-set.7.xsl
blob: 7f1068ecce55416adab2d83ba1e14495a76219d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<xsl:transform
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:exsl="http://exslt.org/common"
  extension-element-prefixes="exsl">

  <xsl:key name="k" match="a" use="@x"/>

  <xsl:template match="/">
    <xsl:variable name="v">
      <n>
        <a x="1" y="A"/>
        <a x="2" y="B"/>
      </n>
    </xsl:variable>
    <xsl:apply-templates select="exsl:node-set($v)/*"/>
  </xsl:template>

  <xsl:template match="n">
<!--    <xsl:apply-templates select="a[@x='1']"/> -->
    <xsl:apply-templates select="key('k','1')"/>
  </xsl:template>

  <xsl:template match="a">
    <xsl:value-of select="@y"/>
  </xsl:template>

</xsl:transform>