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

Sort list based on matching equal to another element

Subject: Sort list based on matching equal to another element
From: Linda Zammit <binky_35@xxxxxxxx>
Date: Thu, 27 Sep 2001 08:36:00 -0400 (EDT)
sort list elements
The list I have displays the LOCATION_NAME sorted by
LOCATION_NAME & START_TIME.

I need the COST to display in the next table cell, by
matching the SHIPMENT_GID from the REPORT_CUSTOMER
element to the REPORT_COST element.

This is what I have for the list of the SHIPMENT_GID
from the REPORT_CUSTOMER - which works great but I
can't figure out how to display the associated cost
for the matching SHIPMENT_GID.

<xsl:key name="records-by-party"
match="REPORT_CUSTOMER/ROW" use="LOCATION_NAME"/>

     <xsl:for-each select="REPORT_CUSTOMER/ROW[count(.
| key('records-by-party', LOCATION_NAME)[1]) = 1]">
       <hr/>
       <xsl:sort select="LOCATION_NAME" />
       <br />
       <xsl:for-each select="key('records-by-party',
LOCATION_NAME)">
       <xsl:sort select="START_TIME" />
       <xsl:value-of select="SHIPMENT_GID" /><br />
       </xsl:for-each>
       </xsl:for-each>

Sample XML:

<REPORT>
	<REPORT_COST>
 		<ROW>
 		<SHIPMENT_GID>123</SHIPMENT_GID>
		</ROW>
		<ROW>
 		<COST>100.00</COST>          <----  HOW DO I GET
THIS AMOUNT IN THE NEXT LIST?  
		</ROW>
	</REPORT_COST>
 	<REPORT_CUSTOMER>
 		<ROW>
 		<SHIPMENT_GID>123</SHIPMENT_GID>
		</ROW>
		<ROW>
 		<LOCATION_NAME>SAM'S PLACE</LOCATION_NAME>
		</ROW>
	</REPORT_CUSTOMER>
</REPORT>




_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca

 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.