[xsl] Distinct Grouping and filtering

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