Go to this URL
(http://techrepublic.com.com/5046-22-0.html?SearchThis=Muenchian+grouping&nodeIds=all&go=GO)
and get this document: - Overcoming decades old legacy systems with XSLT and
Muenchian grouping .
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: Josh Taylor <jktylr(_at_)hotmail(_dot_)com>
Sent: Tue, 01 Mar 2005 09:38:16 -0400
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Grouping by attribute values
I have the following problem. My XML is structured in the following way:
<?xml version="1.0" encoding="UTF-8"?>
<ratePremiums rateDate="20041001" territory="100" type="1">
<coverage id="Liability">
<premium class="1" drivingRecord="0"
limit="200">820.7014415999998</premium>
<premium class="1" drivingRecord="0"
limit="300">853.5294992639998</premium>
<premium class="1" drivingRecord="1"
limit="200">805.7559679999999</premium>
<premium class="1" drivingRecord="1"
limit="300">837.9862067199999</premium>
....
<premium class="12" drivingRecord="2" limit="200">0.0</premium>
<premium class="12" drivingRecord="2" limit="300">0.0</premium>
<coverage>
</ratePremiums>
I need to display premiums grouped first by class, then by driving record
and then by limit in
HTML tables.
So a table for each class, a row for each driving record and a column for
each limit (much like an engineering table).
To elaborate: Desired output for the snipet above is:
Class 1:
<table>
<tr><th></th><th>200 K</th><th>300 K</th></tr>
<tr><td>DR =
0</td><td>820.7014415999998</td><td>853.5294992639998</td></tr>
<tr><td>DR =
0</td><td>805.7559679999999</td><td>837.9862067199999</td></tr>
....
</table>
... etc.
I have no idea how to loop through the premiums, isolated a unique class to
create a table. Then for that class loop through unique driving record
values and display the premiums according to limit.
I do not want to structure my XML with this table view in mind.
Thank you for your time!
- Josh Taylor
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--