home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
-
- <xsl:key name="kDistinctScorers" match="scorer[not(@type) or (@type and @type != 'og')]" use="concat(parent::*/@team,'||',@name)"/>
-
- <xsl:template match="/">
- <html>
- <head>
- <title>
- <xsl:value-of select="/results/@nation"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@sponsor"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@league"/>
- <xsl:text> (stats)</xsl:text>
- </title>
- </head>
- <body>
- <h3>
- <xsl:value-of select="/results/@nation"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@sponsor"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="/results/@league"/>
- <xsl:text> (stats)</xsl:text>
- </h3>
- <hr/>
- <h4>
- <xsl:text>Leading Goal Scorers</xsl:text>
- </h4>
- <table border="1">
- <tr>
- <th>Player</th>
- <th>Team</th>
- <th>Goals</th>
- <th>Pens</th>
- </tr>
- <xsl:apply-templates select="results/result/*/scorer[not(@type) or (@type and @type != 'og')][generate-id() = generate-id(key('kDistinctScorers',concat(parent::*/@team,'||',@name)))]" mode="leading-scorers">
- <xsl:sort select="count(key('kDistinctScorers',concat(parent::*/@team,'||',@name)))" data-type="number" order="descending"/>
- </xsl:apply-templates>
- </table>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="scorer" mode="leading-scorers">
- <tr>
- <td>
- <xsl:value-of select="@name"/>
- </td>
- <td>
- <xsl:value-of select="parent::*/@team"/>
- </td>
- <td align="right">
- <xsl:value-of select="count(key('kDistinctScorers',concat(parent::*/@team,'||',@name)))"/>
- </td>
- <td align="right">
- <xsl:value-of select="count(key('kDistinctScorers',concat(parent::*/@team,'||',@name))[@type = 'pen'])"/>
- </td>
- </tr>
- </xsl:template>
- </xsl:stylesheet>