[xsl] Trying to identify the 3 highest sales results

Subject: [xsl] Trying to identify the 3 highest sales results
From: Arthur Maloney <ArthurM@xxxxxxxxxx>
Date: Mon, 7 Jan 2008 07:21:16 +0000
Hello xsl-list,

 I'm using Xslt(v1.0) to convert an Xml(v1.0) file to Xhtml for browser display
 and trying to add a visual for the top 3 sales result.

 i.e. trying to build
 <td class="first">9</td>
 <td class="second">6</td>
 <td class="third">3</td>
 The CSS class translates to <img src="boldGold.gif" alt="first" />
 I'm Ok with building the Xhtml and adding CSS classes

 When the row template is being processed.
 How Do you Identify if it's the 1st, 2nd or 3rd highest sales figure?
 Typically there are 200-300 salesmen results per calculation and the Xml
 by design,is pre sorted by salesman name.

 
Xslt shard
 <xsl:template match="row">
      <tr>
      ...
      <td>
        <xsl:value-of select="sales"/>
      </td>
      </tr>
</xsl:template>


Xml shard
<table calculated="08W021T07:16">
   <row>
      <agent>Fred Smith</agent>
      ...
      <sales>6</sales>
   </row>
   <row>
      <agent>George Jones</agent>
      ...
      <sales>9</sales>
   </row>
   <row>
      <agent>George Jones Jr</agent>
      ...
      <sales>1</sales>
   </row>
   <row>
      <agent>Karina Houseman</agent>
      ...
      <sales>3</sales>
   </row>
</table>


-- 
Best regards,
 Arthur                          mailto:ArthurM@xxxxxxxxxx

Current Thread