xsl-list
[Top] [All Lists]

FW: Medal Table

2005-01-14 08:18:30

Hello XSL-list,

I hope someone can provide some insight and help :)

I would like and hope to output Nations by the numbers of Golds first, then
Silver and then Bronze in this order.

like this
AUT
        3 Gold, 1 Silver
JAP     
        3 Gold
GBR  
        2 Gold, 1 Bronze

I'm just not sure the best way to tackle the problem

With thanks,
Gavin Lyons 
http://www.i386.com

XSL
---
        <xsl:for-each select="Table[not (nation='')]">
                <xsl:sort select="nation" />                    
                        <xsl:variable name="nation"><xsl:value-of
select="nation"/></xsl:variable>
                        <xsl:value-of select="nation"/> <br/>
                        - Gold <xsl:value-of
select="count(../Table[medal='Gold' and nation=$nation])"/>
                        - Silver <xsl:value-of
select="count(../Table[medal='Silver' and nation=$nation])"/>
                        - Bronze <xsl:value-of
select="count(../Table[medal='Bronze' and nation=$nation])"/>
        </xsl:for-each>

XML
---
  <Table>
    <athlete>Jones John</athlete>
    <nation>GBR</nation>
    <location>Bormio</location>
    <date>01/29/2005</date>
    <medal>Gold</medal>
    <discipline>Super-G</discipline>
    <gender>Mens</gender>
    <lastmodified></lastmodified>
    <editedby></editedby>
  </Table>
  <Table>
    <athlete>Burt Sample</athlete>
    <nation>FRA</nation>
    <location>Bormio</location>
    <date>01/29/2005</date>
    <medal>Silver</medal>
    <discipline>Super-G</discipline>
    <gender>Mens</gender>
    <lastmodified></lastmodified>
    <editedby></editedby>
  </Table>




 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 10/01/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 10/01/2005
 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>