[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Sorting with variable

Subject: Sorting with variable
From: Florian Mueller <jjdm@xxxxxxxx>
Date: Thu, 04 Mar 2004 15:50:19 +0100
xsl summe
Hello everybody

<xsl:for-each select="//day">
	<xsl:variable name="day" select="."/>
		<xsl:for-each select="//gv/activity[generate-id()=generate-id(key('activity_key',@name))]">
			<xsl:sort select="./hits" data-type="number" order="descending"/>	
			<xsl:variable name="uname" select="@name"/>
			<xsl:variable name="activity" select="$day/gv/activity[@name=$uname]/@name"/>
			<xsl:variable name="summe" select="sum($activity/../..//activity[@name=$uname]/hits)"/>		
			<!-- $summe has the right value -->
			<xsl:sort select="$summe" data-type="number" order="descending"/>	
			<!-- print unsorted -->
			<xsl:value-of select="$summe"/>
		</xsl:for-each>
</xsl:for-each>

My goal is, to sort the "activity" with the "summe". So i want to have for example the following result:

act1                       34
act2                       12
act3                         1

But the script doesnt work. Maybe because i use a variable in the sort-statement?

Anyone knows something about this?

Kindly regards
Florian Mueller

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.