Thank you very much Michael. It's working.
Regards,
Manish
-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: Thursday, February 07, 2008 7:06 PM
To: Manish_Jaiswal; xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: first n nodes from a current-group
But I wanted only the first two name elements having highest counts.
that is output like:
Try
<School>
<xsl:for-each-group select=" School/student
group-by="name/tokenize(., ';\s*')">
<xsl:sort data-type="number" select="count(current-group())"
order="descending" />
<xsl:sort select="current-grouping-key()"/>
<xsl:if test="position() <= 2">
<name count="{count(current-group())}">
<xsl:value-of select="current-grouping-key()"/>
</name>
</xsl:if>
</xsl:for-each-group>
</School>
Michael Kay
http://www.saxonica.com/
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE
COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the
sender by email and delete all copies; your cooperation in this regard is
appreciated.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--