This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: return nodeset to xsl:variable
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] return nodeset to xsl:variable
- From: Francis Norton <francis at redrice dot com>
- Date: Thu, 08 Mar 2001 17:20:14 +0000
- References: <000c01c0a7c7$7b927460$4f4b3c3e@oemcomputer>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Michael Kay wrote:
>
> > I see how to set an xsl:variable by 'returning' a string from a called
> > template, but how do you return a node set to an xsl:variable?.
>
> A called template doesn't actually return a result, it writes to a tree.
>
> What do you actually want to achieve?
>
A general note - if you want to get a nodeset into a variable, and it
can be generated by a single XPath expression, then you can do this with
xsl:variable/@select.
If you want to create a variable which contains a nodeset which can only
be generated with XSLT logic, then the short answer is you can't. But in
fact you can work round this if you need to badly enough by using
parameters instead, typically building up the contents of a parameter by
recursive calls until it is complete, and then calling the next stage in
your transform with your complete value as an input parameter.
Francis.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list