[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Sorting in descending order on the sum of a calcul
> I am rather new to xml and this list... I am trying to convert a stats > program I wrote into xml / xsl format and I am having trouble > getting one of > the xsl style sheets to work. I need to sort the result of a > sum performed > on an xml attribute in descending order by the total sum > retrieved. I can > sum all of the like fields in a table for display but I am > having trouble > getting it to then display in descending order. Tackle this as a two phase transformation, phase one to do the summation and phase two to do the sorting. Put the intermediate results in a result tree fragment, and process it for phase two using the xx:node-set() extension function that comes with your chosen processor. <xsl:variable name="phase1out"> <xsl:apply-templates select="/" mode="phase1"/> </xsl:variable> <xsl:template match="/"> <xsl:apply-templates select="xx:node-set($phase1out)" mode="phase2"/> </xsl:template> Mike Kay 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
|