On 21.10.2010 16:12, Mukul Gandhi wrote:
Hi Julian,
On Mon, Oct 18, 2010 at 8:28 PM, Julian Reschke<julian.resc...@gmx.de> wrote:
<xsl:variable name="t">
<root>
<x>1</x>
<x>2</x>
<x>3</x>
</root>
</xsl:variable>
<xsl:variable name="tns" select="exslt:node-set($t)/root/x"/> [1]
<xsl:call-template name="foo">
<xsl:with-param name="t" select="$tns"/>
<xsl:with-param name="i" select="'1'"/>
</xsl:call-template>
<xsl:template name="foo">
<xsl:param name="t"/>
<xsl:param name="i"/>
<xsl:variable name="tns" select="exslt:node-set($t)"/> [2]
Since at line [1], you've already constructed a node-set then what's
the need of doing again node-set($t) at [2] ?
At some point I got an error and thought that passing a nodeset as a
parameter to a template would turn it into a RTF. (That code was more
complex, so I'll have to investigate).
At line [2] I believe, $t is already a node-set and must be accessed
simply like $t and not node-set($t).
Thought I haven't cross checked what's Xalan's behavior when we do for example:
xx:node-set(xx:node-set($rtf)) which is what I understand you've
intended to mean with your syntax. And this logically looks wrong to
me.
My expectation is that applying node-set() to a node set should be
harmless, but
<http://www.exslt.org/exsl/functions/node-set/index.html>
indeed doesn't say -- but I'm ready to say it's the only sane thing to do...
Best regards, Julian