Use of xsl:key problem in xslt 2
Hello,
I am getting a problem in using xsl:key in xslt2. I am trying to group the nodes.
I am using nxslt2 for transformation. When i was using nxslt (version 1.1), then the keys were working fine means the nodes are grouped, but as soon as i shifted to nxslt2, the grouping fails.
Can anybody tell me the cause.
Below is the xml ans xslt
XML:-
<Abd>
<AbdUid>
<AseUid>
<codeType>FIR</codeType>
<codeId>AMSWELL</codeId>
</AseUid>
</AbdUid>
</Abd>
<IAS_Avx>
<IAS_AvxUid>
<AbdUid>
<AseUid>
<codeType>FIR</codeType>
<codeId>AMSWELL</codeId>
</AseUid>
</AbdUid>
<noSeq>1</noSeq>
</IAS_AvxUid>
<codeType>GRC</codeType>
<geoLat>570500.0000N</geoLat>
<geoLong>0400000.0000W</geoLong>
<codeDatum>WGE</codeDatum>
</IAS_Avx>
XSLT:
<xsl:template match="Abd">
<xsl:variable name="Codeuid" select="codeType"/> <xsl:variable name="uid" select="AbdUid"/>
<xsl:for-each select="AbdUid[ count(. | key('AbdCode_key',$uid)[1]) = 1]">
<Abd>
<xsl:copy-of select="$uid"/>
<xsl:for-each select="key('Abd_key',$uid)">
<xsl:if test="codeType != 'CIR'">
<Avx>
<xsl:copy-of select="."/>
</Avx>
</xsl:if>
</xsl:for-each>
</Abd>
</xsl:template>
Please tell me is there any change in using xslt2
|