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


> 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 
to be a tree frag or a plain var, especially when dragging vars through 
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 


Microsoft: HOWTO: Read the Fucking Manual

"This article demonstrates how to read the fucking manual"

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