From: G. Ken Holman [mailto:gkholman(_at_)CraneSoftwrights(_dot_)com]
Sent: Wednesday, January 08, 2003 9:18 AM
Subject: Re: [xsl] Yet another grouping question
At 2003-01-08 08:17 -0700, Martinez, Brian wrote:
Now comes the grouping issue. Cities served by multiple airports are
repeated in the table:
<tr>
<td>Buenos Aires</td>
<td>Jorge Newbery</td>
<td>AEP</td>
</tr>
<tr>
<td>Buenos Aires</td>
<td>Ministro Pistarini</td>
<td>EZE</td>
</tr>
Obviously I'd like both of these airports listed in one city
node for Buenos
Aires, but I can't figure out how to modify my stylesheet to
do this. I
don't think I can use methods involving keys
Grouping isn't only accomplished through keys ... I often use
variables and
variables work across files.
I mocked up some data and the following seems to work fine in
a small test.
I hope this helps.
Thanks Ken--returning a node-set from the tables in all files instead of
iterating through each file seems to make more sense. However, that does
present a secondary grouping problem--your stylesheet outputs a separate
country node for each city. I think combining your approach with Niko's
suggestion of doing a second pass on the output (and using a key) will do
the trick.
thanks again,
b.
| brian martinez
brian(_dot_)martinez(_at_)trip(_dot_)com |
| senior gui programmer 303.708.7248 |
| trip network, inc. fax 303.790.9350 |
| 6436 s. racine cir. englewood, co 80111 |
| http://www.cheaptickets.com/ http://www.trip.com/ |
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list