xsl-list
[Top] [All Lists]

RE: Sorting Problem

2005-07-08 16:18:36
With Saxon 8.4 I get

   <tr>
      <td>Jason</td>
      <td>filterBean</td>
      <td>1</td>
   </tr>
   <tr>
      <td>Matt</td>
      <td>retrieveUserPreferencesBean</td>
      <td>1</td>
   </tr>
   <tr>
      <td>Joe</td>
      <td>retrieveUserPreferencesBean</td>
      <td>2</td>
   </tr>

What product/version are you using?

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Dhami, Ankit (UMR Student) [mailto:atdhfb(_at_)umr(_dot_)edu] 
Sent: 07 July 2005 15:13
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Sorting Problem

Hi guys,

Here is the XML file:

<all>
<log_entry run_time="4084" 
action="retrieveUserPreferencesBean" username="Matt"/>
<log_entry run_time="4085" action="filterBean" username="Jason"/>
<log_entry run_time="4086" 
action="retrieveUserPreferencesBean" username="Joe"/>
<log_entry run_time="4087" 
action="retrieveUserPreferencesBean" username="Joe"/>
</all>


Here is the sorting part of XSL file:

<xsl:for-each-group select="//log_entry" group-by="@action">
<xsl:sort select="count(current-group()/@action)" order="ascending"/>
<xsl:for-each-group select="current-group()" group-by="@username">
<tr>
<td><xsl:value-of select="./@username"/></td>
<td><xsl:value-of select="./@action"/></td>
<td><xsl:value-of select="count(current-group()/@action)"/></td>
</tr>
</xsl:for-each-group> 
</xsl:for-each-group> 


The output HTML is:

<tr>
<td>Matt</td>
<td>retrieveUserPreferencesBean</td>
<td>1</td> ..........( count field)
</tr>
<tr>
<td>Joe</td>
<td>retrieveUserPreferencesBean</td>
<td>2</td>..........( count field)
</tr>
<tr>
<td>Jason</td>
<td>filterBean</td>
<td>1</td>..........( count field)
</tr>

which is not as expected since it did not sort it based on count.


Here, I am trying to sort the "count" column based on value 
obtained by function count().

Any replies appreciated.

Thanks,


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





--~------------------------------------------------------------------
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>
  • Sorting Problem, Dhami, Ankit \(UMR Student\)
    • RE: Sorting Problem, Michael Kay <=