[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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]"> ... </xsl:for-each> "." 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 Hi: 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 value. 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 solution.
|
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
|