|
Subject: [xsl] 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) |
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Euro symbol, Rafael 'Dido' Sevill | Thread | Re: [xsl] Sort list based on matchi, Jeni Tennison |
| RE: [xsl] Grouping nodes by 4 using, Michael Kay | Date | [xsl] Re: Re: loop in creation of t, Dimitre Novatchev |
| Month |