[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Sorting with variable
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|