[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Selecting from a node-set using variable path

Subject: Re: Selecting from a node-set using variable path
From: S Woodside <sbwoodside@xxxxxxxxx>
Date: Tue, 18 Feb 2003 20:53:49 -0500
xsl 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>

in that case it's wonky but xslt doesn't like to have two variables in the same xpath AFAICT.

simon

On Tuesday, February 18, 2003, at 02:35 PM, gary fong wrote:

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.

---
www.simonwoodside.com

<http://ThisURLEnablesEmailToGetThroughOverzealousSpamFilters.org>


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.