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

Distinct Grouping and filtering

Subject: [xsl] Distinct Grouping and filtering
From: "KUMAR NINGASHETTY" <kningashetty@xxxxxxxxxxxxxxxx>
Date: Tue, 28 May 2002 16:42:27 -0400
distinct grouping
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


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.