From: S Woodside [mailto:sbwoodside(_at_)yahoo(_dot_)com]
Sent: Tuesday, February 18, 2003 6:54 PM
Subject: Re: [xsl] Selecting from a node-set using variable path
If $mypath is a string, you'll need to use dyn:evaluate from EXSLT or
whatever equivalent you can find for your interpreter.
if $mypath is a nodeset defined by an XPath, e.g.
<xsl:variable name="myPath" select="a/b/c"/>
then I think you might be able to do something like this:
<xsl:template match="$myNodeSet>
<xsl:apply-templates select="$myPath"/>
</xsl:template>
You can't use a VariableReference in a match pattern in xsl:template. You
could, however, define myNodeSet and use it in a select expression:
<xsl:apply-templates select="$myNodeSet"/>
then you would need a set of templates matching the possible values of
$myNodeSet, then apply templates again using $myPath as you have here.
($myPath would either have to be defined globally or passed as a param.)
cheers,
b.
| brian martinez
brian(_dot_)martinez(_at_)trip(_dot_)com |
| senior gui programmer 303.708.7248 |
| trip network, inc. fax 303.790.9350 |
| 6436 s. racine cir. englewood, co 80111 |
| http://www.cheaptickets.com/ http://www.trip.com/ |
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list