Subject: RE: [xsl] Selecting from a node-set using variable path From: "Martinez, Brian" <brian.martinez@xxxxxxxx> Date: Wed, 19 Feb 2003 07:06:14 -0700 |
> From: S Woodside [mailto:sbwoodside@xxxxxxxxx] > 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.martinez@xxxxxxxx | | 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Getting position of paren, Geoff Hankerson | Thread | [xsl] Code Structure Question, Michael A. Thompson |
RE: [xsl] The Perils of Sudden Type, Michael Kay | Date | Re: [xsl] xslt coding conventions, Joe Fawcett |
Month |