|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








