[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how to number on a grouped and sorted set?
I'm working with a group and sort set defined like this and just want to write the order (number - 1,2,3,etc.) into the last element called <rank>. How do I do that? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="g" match="result" use="cuicode"/> <xsl:output indent="yes"/> <xsl:template match="/"> <ConceptResults> <xsl:for-each select="ConceptResults/result[generate-id(.)=generate-id(key('g',cuicode)[1] )]"> <xsl:sort data-type="number" select="sum(key('g',cuicode)/bitmask)" order="descending"/> <xsl:sort data-type="number" select="key('g',cuicode)/count" order="descending"/> <xsl:sort data-type="number" select="key('g',cuicode)/offset" order="descending"/> <xsl:variable name="results-with-same-cuicode" select="key('g',cuicode)"/> <result> <url><xsl:value-of select="url"/></url> <offset><xsl:value-of select="offset"/></offset> <phrase><xsl:value-of select="phrase"/></phrase> <bitmask><xsl:value-of select="sum($results-with-same-cuicode/bitmask)"/></bitmask> <cui><xsl:value-of select="cui"/></cui> <count><xsl:value-of select="count(key('g',cuicode))"/></count> <cuicode><xsl:value-of select="cuicode"/></cuicode> <cuidscr><xsl:value-of select="cuidscr"/></cuidscr> <rank><xsl:number level="single" from="."/></rank> <---------------------------------------- how do I get the grouped number and not the original number </result> </xsl:for-each> </ConceptResults> </xsl:template> </xsl:stylesheet> thanks, chad. 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
|