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

Finding the "correct" context node in a for-each with

Subject: Finding the "correct" context node in a for-each with multiple predicates
From: "Ericsson, Mikael" <Mikael.Ericsson@xxxxxxxxx>
Date: Mon, 7 Jul 2003 17:24:37 +0200
xsl for each context
Hi,
 
Let's say there's an XML with a list of spots:
 
<spot name="Alpha" value="Kilo"/>
<spot name="Bravo" value="Lima"/>
...
 
And another XML-file with a number of "foo", each having a number of children "bar":
<foo location="Kilo">
    <bar type="Alpha"/>
        ...
</foo>
...
 
Now I want to to work through the set of nodes in the spot list that match the select I'm trying to describe below:
 
<xsl:for-each select="spot[foo[@location=<attribute value from spot>]/bar[@type=<attribute name from spot>]]">
 
So the question is how do I access the attributes of the spot currently under test? I know that I could write e.g. 
 
<xsl:for-each select="spot[@name=foo[@location]"> 
 
if it was just one attribute that I wanted to match, but my expression is more complex than that (even the expression here is simplified).
I've tried 
 
<xsl:for-each select="spot[foo[@location=./@value]/bar[@type=./@name]]"> 
 
without success and I think that is because that expression searches for a value attribute of foo and a name attribute of bar, respectively.
regards,
Mike

 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.