[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?

Subject: how to number on a grouped and sorted set?
From: Chad Small <chad.small@xxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Nov 2000 16:53:41 -0400 (EST)
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


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.