Subject: RE: [xsl] Selecting from a node-set using variable path From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 18 Feb 2003 20:45:36 -0000 |
Xpath expressions in XSLT have to be known at compile-time, they can't be constructed from strings. Look for a processor that offers an xx:evaluate() extension function; or find a different approach to your problem. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of gary fong > Sent: 18 February 2003 19:35 > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Selecting from a node-set using variable path > > > For the life of me, I don't know how to do this even > though it seems like it would be very easy. > > I have a variable, myNodeSet, which points to a node set, > in this case a set of 1 document element node. > I have another variable, myPath, which reflects a > (relative) location path to nodes I want to select from myNodeSet. > > This works: > <xsl:variable name="t1" select="$myNodeSet//a/b/c"/> > > This doesn't: > <xsl:variable name="t2" select="$myNodeSet/$myPath"/> > > I'm using MSXML 4.0 and it's complaining with: > NodeTest expected here. > $myNodeSet/-->$<--myPath > which makes sense. > > How do I filter down my node-set based upon some variable > location path? > > Thanks > -- > Gary F. > Sr. Software Engineer > Fast Track Systems, Inc > > > > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Selecting from a node-set, J.Pietschmann | Thread | Re: [xsl] Selecting from a node-set, S Woodside |
RE: [xsl] The Perils of Sudden Type, Michael Kay | Date | [xsl] Re: Re: How can I translate a, Dimitre Novatchev |
Month |