|
[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Distinct Grouping and filtering
Subject: Re: [xsl] Distinct Grouping and filtering
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Tue, 28 May 2002 23:01:25 +0200
|
Does this help??
http://sources.redhat.com/ml/xsl-list/2002-05/msg01261.html
Joerg
KUMAR NINGASHETTY wrote:
Hi,
In the following xml i need to group by "reg_name" as the outer group and then groupby "stateid" at the next level
Basically need to group applicants whose stateid belonging to same region .Within which only distinct stateid should be
picked .Duplicate stateid belonging to same region need to be filtered.
I did try using Keys and preceeding sibling comparision approach .But i guess i didnt do it right ...ANy pointers .
Result looks like :
―----------------------
Reg1
GA
<some row of data>
PA
<some row of data>
Reg2
NY
<some row of data>
VA
<some row of data>
Reg3
NY
<some row of data>
GA
<some row of data>
Source XML is :
―--------------------
<stream>
<rep>
<states>
<region id="111">
<reg_name>Reg1</reg_name>
<region>
<region id="333">
<reg_name>Reg3</reg_name>
<region>
<region id="222">
<reg_name>Reg2</reg_name>
<region>
</states>
<apps>
<applicant idref="111" statid="GA">
<company>xxx</company>
<amount>2200</amount>
</applicant>
<applicant idref="333" statid="NY">
<company>yyyy</company>
<amount>3200</amount>
</applicant>
<applicant idref="333" statid="GA">
<company>zz</company>
<amount>4200</amount>
</applicant>
<applicant idref="222" statid="NY">
<company>pp</company>
<amount>5200</amount>
</applicant>
<applicant idref="222" statid="VA">
<company>qq</company>
<amount>6200</amount>
</applicant>
<applicant idref="111" statid="GA">
<company>rr</company>
<amount>7200</amount>
</applicant>
<applicant idref="111" statid="PA">
<company>ss</company>
<amount>8200</amount>
</applicant>
</apps>
</rep>
</stream>
THanks for your time
-Kum
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|