This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How can I declare node sets explicitly?
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: How can I declare node sets explicitly?
- From: "Nick-Lawson.org" <nick at nick-lawson dot org>
- Date: Sat, 14 Oct 2000 17:31:44 +0100
- Reply-To: xsl-list at mulberrytech dot com
> I would like to specify a node set explicity and declare it in a
> variable. For the moment, I am doing something like,
>
> <xsl:apply-templates="(field1)|(field2)|(field3)"/>
>
> but in order to provide easier extensibility, I would like to declare
> this elsewhere. However, as you pointed out,
>
> <xsl:variable name="local_field">
> (field1)|(field2)|field3)
> </xsl:variable>
>
> won't work because then $local_field is a string and not a node set.
>
> Do you have any suggestion for me?
>
> Thanks for your help and best regards,
> Matthias
Do:
<xsl:variable name="local-field" select="field1 | field2 | field2"/>
Now $local-field IS a node-set! So you can do:
<xsl:apply-templates select="$local-field"/>
or whatever.
Nick Lawson
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list