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

RE: Grouping by attribute values

Subject: RE: Grouping by attribute values
From: cknell@xxxxxxxxxx
Date: Tue, 01 Mar 2005 08:49:40 -0500
grouping by attribute values
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@xxxxxxxxxx - email



-----Original Message-----
From:     Josh Taylor <jktylr@xxxxxxxxxxx>
Sent:     Tue, 01 Mar 2005 09:38:16 -0400
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:   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

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.