Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2005, 06:42 AM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not sorting as expected

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,
anki
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
expected Then Adam H-W Classic ASP Basics 6 April 17th, 2008 05:41 AM
expected ';' RoniR Javascript 3 February 1st, 2007 05:28 AM
Expected 'Then' Adam H-W Classic ASP Basics 5 July 26th, 2004 02:36 PM
Datagrid sorting by non alphabetical sorting? LLAndy VS.NET 2002/2003 1 July 15th, 2004 01:20 AM



All times are GMT -4. The time now is 03:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.