I am having trouble understanding how the exsl:node-set function works.
I have some XML which I am expanding and using to dynamically populate an exsl:node-set. Let's say it currently is in this format:
<xsl:variable name="wrap">
<nodes>
<node/>
<node/>
<node/>
</nodes>
</xsl:variable>
<xsl:variable name="wrapNodeSet" select="exsl:node-set($wrap)"/>
This works as required and outputting $wrapNodeSet shows the nodes markup above. Root node name is show as 'nodes' using name($wrapNodeSet/*).
Now I need to expand this to have 2 nodes and to populate the nodeset dynamically. So:
<xsl:variable name="wrap">
<nodes tier="a">
<node/>
<node/>
<node/>
</nodes>
<nodes tier="b">
<node/>
<node/>
<node/>
</nodes>
</xsl:variable>
<xsl:variable name="wrapNodeSet" select="exsl:node-set($wrap)/nodes[@tier='b']"/>
Outputting the node set includes the nodes element but outputting the name of the root node now changes to 'node'.
Can someone explain why the nodes element is still output?