I have below xsl code which is not giving me sort on SEC_Match element:
<xsl:template match="*[SEC]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:for-each select="*">
<xsl:variable name="a" select="substring-before(@UID,'^')"/>
<xsl:choose>
<xsl:when test="self::SEC[$a = substring-before(following-sibling::SEC[1]/@UID,'^')]|self::SEC[$a = substring-before(preceding-sibling::SEC[1]/@UID,'^')]">
<xsl:for-each select="self::SEC[$a = substring-before(following-sibling::SEC[1]/@UID,'^')]|self::SEC[$a = substring-before(preceding-sibling::SEC[1]/@UID,'^')]">
<xsl:sort select="@STARTEFFDATE" data-type="number" order="descending"/>
<SEC_Match>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</SEC_Match>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:copy>
</xsl:template>