Re: [xsl] How do I build a nodeset "programmatically" for passing to another template?

Subject: Re: [xsl] How do I build a nodeset "programmatically" for passing to another template?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 17 Aug 2006 12:04:41 -0400
At 11:59 AM 8/17/2006, David wrote:
in xsl 1.1 draft (and xsl2 draft which is implemented in saxon 8) then
you can do just as you suggest

<xsl:variable name="something">
 ... xsl code ..
</xsl:variable>

then
select="$something/*"

(note that $something is always a root node / soto select the top level
element (or elements) that you create in the variable you need to
use a path such as $something/*

It's a good point: this will probably be a gotcha, especially since sometimes (for example, when applying templates in a mode) select="$something" will work just fine, and other times (for example when applying templates not in a mode) it will fail inexplicably and spectacularly.


Cheers,
Wendell

Current Thread