xsl-list
[Top] [All Lists]

[xsl] RE: first n nodes from a current-group

2008-02-07 06:37:03

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/



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>