This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Acheiving ..2nd level grouping but with different nodestructure ..
- From: "KUMAR NINGASHETTY" <kningashetty at deltafunding dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 24 Jul 2002 08:59:41 -0400
- Subject: [xsl] Acheiving ..2nd level grouping but with different nodestructure ..
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi everybody ...
Sorry to repost ... I thought this may be good time to post for someone to look ..
This seemed little different having different parent nodes for 2nd level grouping using keys ..
Here is my XSL with first level grouping extracting distinct regions and i am having problems grouping users within Region .
Any help appreciated .
Following is XSL (presently pulling distinct regions ) .. an Examle XML and expected result .
Note : I applied Keys to do 2nd level for users but i was able to pull out only 1 row in each region where as
there are many userid's as shown below.
_______________My XSL _____________________
<xsl:key name="distinct-region" match="*" use="@reg"/>
<xsl:template match="/">
<xsl:for-each select="rep/uwr/los[@reg][generate-id()=generate-id(key('distinct-region', @reg))]">
<xsl:value-of select="@reg"/>
</xsl:for-each>
</xsl:template>
_________________XML______________________________
<rep>
<uwr>
<los userid="1014" reg="Region 4">
<review type="N"><![CDATA[11]]></review>
<review type="Y"><![CDATA[16]]></review>
</los>
<los userid="1017" reg="Region 4">
<review type="N"><![CDATA[7]]></review>
<review type="Y"><![CDATA[17]]></review>
</los>
<los userid="1025" reg="Region 2">
<review type="N"><![CDATA[13]]></review>
<review type="Y"><![CDATA[12]]></review>
</los>
</uwr>
<arr>
<los userid="1014" reg="Region 4">
<review type="N"><![CDATA[15]]></review>
<review type="Y"><![CDATA[19]]></review>
</los>
<los userid="1017" reg="Region 4">
<review type="N"><![CDATA[20]]></review>
<review type="Y"><![CDATA[22]]></review>
</los>
<los userid="1025" reg="Region 2">
<review type="N"><![CDATA[23]]></review>
<review type="Y"><![CDATA[25]]></review>
</los>
</arr>
</rep>
____________Expected Result__________________________
Region 4
Userid UWR(N) UWR(Y) ARR(N) ARR(Y)
1014 11 16 15 19
1017 7 17 20 22
Region 2
Userid UWR(N) UWR(Y) ARR(N) ARR(Y)
1025 13 12 23 25
Thanks
- Kumar
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list