Re: [xslt] Selecting on nodeset in variable from stylesheet



Hi

> So I guess my stylesheet should have looked like this:
>
> <xsl:variable name="foo"><name>bar</name></xsl:variable>
> <xsl:value-of select="exslt:node-set($foo)/name"/>
>
> Ok, fair enough.  I think it is a particularly ugly thing that you 
> need to do to get the result you expect.  I assume that will be better 
> in XSLT 2.0...  ;-)

I agree. plus, after months I'm still confused as to when a var turns 
out
to be a tree frag or a plain var, especially when dragging vars through 
templates
and functions ...

in practice, i turn every var i need to approach as a treefrag
into a node-set right away, eg:

> <xsl:variable name="foo-src"><name>bar</name></xsl:variable>
> <xsl:variable name="foo"><xsl:value-of 
> select="exslt:node-set($foo-src)"/></xsl:variable>
....[other code]
> <xsl:value-of select="$foo/name"/>

btw, the saxon interpreter _does_ treat tree fragments as you would 
expect them,
which is probably against the specs, and not portable, but more 
intuitive.

....
*pike

=========
Microsoft: HOWTO: Read the Fucking Manual

"This article demonstrates how to read the fucking manual"
http://radio.weblogs.com/0001263/junk/Q209354%20-%20HOWTO.html




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]