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

Re: How do I change a XSL style sheet to group data t

Subject: Re: How do I change a XSL style sheet to group data together under one heading
From: "kieters c" <kieters@xxxxxxxxxxx>
Date: Mon, 21 May 2007 12:03:25 +0000
Re:  How do I change a XSL style sheet to group data  t
The resuslt I need to get is :

<sample sample_date_time="20061001" cp_name="Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=" " sample_comment=" ">
<result rpttime_name="Daily" sis_imis_code="RSP" parm_name="Residue, particulate" >
<result rpttime_name="Daily" sis_imis_code="FTFLOW" parm_name="Flow" />
</sample>


In other words sample_date_time, cp_name, dischg_sample_cd, ect grouped together and the rest grouped with result.


Thank you.


Hennie
From: Abel Braaksma <abel.online@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: How do I change a XSL style sheet to group data together under one heading
Date: Mon, 21 May 2007 12:48:40 +0200


kieters c wrote:
Thank you. I did not see the one although I tried to check on all the brackets. I found another one missing two lines down.

I used XML Notepad 2007 to do the transformation and the result remain the same as previously reported. Only sample_date_time is seperated and all other is include in result. I added all the other that should be grouped with sample_date_time but it made not difference.


I just tried it with the last sample data "flat file" (it is not flat, it is still xml) and changed your sample to contain different groups for the combination sample_date_time and cp_name. It worked perfectly well for me. The sample data I used after I removed some of the noise was this:


<dataroot>
   <sample>
       <sample_date_time>20070101</sample_date_time>
       <cp_name>Neutr. Sump WTPE</cp_name>
       <imis_cp_ext>2300</imis_cp_ext>
       <dischg_sample_cd/>
   </sample>
   <sample>
       <sample_date_time>20070102</sample_date_time>
       <cp_name>Neutr. Sump WTPE</cp_name>
       <imis_cp_ext>2300</imis_cp_ext>
       <dischg_sample_cd/>
   </sample>
   <sample>
       <sample_date_time>20070101</sample_date_time>
       <cp_name>Neutr. Sump WTPE</cp_name>
       <imis_cp_ext>2300</imis_cp_ext>
       <dischg_sample_cd/>
   </sample>
   <sample>
       <sample_date_time>20070101</sample_date_time>
       <cp_name>22Neutr. Sump WTPE</cp_name>
       <imis_cp_ext>2300</imis_cp_ext>
       <dischg_sample_cd/>
   </sample>
   <sample>
       <sample_date_time>20070101</sample_date_time>
       <cp_name>33Neutr. Sump WTPE</cp_name>
       <imis_cp_ext>2300</imis_cp_ext>
       <dischg_sample_cd/>
   </sample>
   <sample>
       <sample_date_time>20070101</sample_date_time>
       <cp_name>22Neutr. Sump WTPE</cp_name>
       <imis_cp_ext>2300</imis_cp_ext>
       <dischg_sample_cd/>
   </sample>
</dataroot>


which returned the following output when run against the stylesheet: (note the added numbers for cp_name attributes to make them distinguishable)


<submission imis_company_code="0001843309" ws_name="LENNOX">
<sample sample_date_time="20070101">
<result cp_name="Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=""/>
<result cp_name="Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=""/>
</sample>
<sample sample_date_time="20070102">
<result cp_name="Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=""/>
</sample>
<sample sample_date_time="20070101">
<result cp_name="22Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=""/>
<result cp_name="22Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=""/>
</sample>
<sample sample_date_time="20070101">
<result cp_name="33Neutr. Sump WTPE" imis_cp_ext="2300" dischg_sample_cd=""/>
</sample>
</submission>



which, as you can see, is grouped by both sample_date_time and cp_name (i.e., if both are concatenated the same, they are grouped together).


Cheers,
-- Abel Braaksma


_________________________________________________________________
Make free PC-to-PC calls with no loss of life! http://www.communicationevolved.com/en-za/


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.