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

RE: Finding Nodes That Match Distinct Node Value

Subject: RE: Finding Nodes That Match Distinct Node Value
From: Tony Nassar <tnassar@xxxxxxxxxxxxxxxx>
Date: Fri, 9 May 2008 14:16:08 -0700
 RE: Finding Nodes That Match Distinct Node Value
I'm pretty sure that you need to something like:

<xsl:variable name="festival" select="."/>
<xsl:for-each select="//Artist[@festival = $festival]">

"." is evaluated relative to where the you've gotten in the tree by means of
the XPath expression, not to where you were.

-----Original Message-----
From: Trish@xxxxxxxxxxxxxx [mailto:Trish@xxxxxxxxxxxxxx]
Sent: Thursday, May 08, 2008 11:50 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Finding Nodes That Match Distinct Node Value


I want to loop through an xml document and get distinct values from an
attribute and then find all sibling nodes that have that attribute

I'm pulling distinct festivals based on @festival within each artist
just fine, but then I want to go back and get all of the Artist info per
festival. It seems like the code I'm using to do this should work, but
it doesn't. I can't change the organization of the xml. I'm trying not
to use keys. I only have access to XSL 1.0 for this project. The line I
need help with is:
<xsl:for-each select="//Artist[@festival = .]">

I'm guessing that the value of "." is lost because I'm beginning at the
top of the document again. I'm certain that one of you has an elegant

Current Thread


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.
First Name
Last Name
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.