Source de foot.xsl
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="DTD/xhtml1-strict.dtd" indent="yes" />
<xsl:template match="/CHAMPIONNAT">
<html>
</xsl:template><head>
<title>
Ligue <xsl:value-of select="@DIVISION" />, saison <xsl:value-of select="@SAISON" />
</title><link rel="stylesheet" href="foot.css" />
<meta name="robots" content="noindex" />
</head><body>
</html><div class="pagelarge">
</body><h1>
Résultats de ligue <xsl:value-of select="@DIVISION" />,
saison <xsl:value-of select="@SAISON" />
</h1><p>
Cette page est produite dans le cadre d'exercices sur XSLT. Son contenu n'est peut-être pas pertinent.
</p><ul>
<li>
retour aux <a href="https://fabien-torre.fr/Enseignement/tp/XML/Corrections/#xsltfoot">solutions des exercices XML</a>
</li><li>
retour aux <a href="https://fabien-torre.fr/Enseignement/tp/XML/XSLT/">exercices XSLT</a>
</li><li>
</ul>retour à la page de <a href="https://fabien-torre.fr/">Fabien Torre</a>
</li><h2>Statistiques sur les conclusions des rencontres</h2>
<fieldset class="sommaire">
<legend>Sommaire</legend>
<ul>
</fieldset><xsl:apply-templates select="/CHAMPIONNAT/JOURNEE" mode="sommaire" />
</ul><xsl:variable name="nb_matches" select="count(//RENCONTRE)" />
<xsl:variable name="nb_victoires" select="count(//RENCONTRE[@SCORED > @SCOREE])" />
<xsl:variable name="pc_victoires" select="format-number(100.*$nb_victoires div $nb_matches,'##.##')" />
<xsl:variable name="nb_defaites" select="count(//RENCONTRE[@SCORED < @SCOREE])" />
<xsl:variable name="pc_defaites" select="format-number(100.*$nb_defaites div $nb_matches,'##.##')" />
<xsl:variable name="nb_nuls" select="count(//RENCONTRE[@SCORED = @SCOREE])" />
<xsl:variable name="pc_nuls" select="format-number(100.*$nb_nuls div $nb_matches,'##.##')" />
<table>
<tr>
<th>Victoires de l'équipe à domicile</th>
<td align="right">
<xsl:value-of select="$nb_victoires" />/<xsl:value-of select="$nb_matches" />
</td><td align="right">
</tr><xsl:value-of select="$pc_victoires" />%
</td><tr>
<th>Victoires de l'équipe à l'extérieur</th>
<td align="right">
<xsl:value-of select="$nb_defaites" />/<xsl:value-of select="$nb_matches" />
</td><td align="right">
</tr><xsl:value-of select="$pc_defaites" />%
</td><tr>
</table><th>Matches nul</th>
<td align="right">
<xsl:value-of select="$nb_nuls" />/<xsl:value-of select="$nb_matches" />
</td><td align="right">
</tr><xsl:value-of select="$pc_nuls" />%
</td><br />
<br />
<embed src="stats.svg" width="400" height="400" type="image/svg+xml" />
<hr />
<xsl:apply-templates select="/CHAMPIONNAT/JOURNEE" />
</div><xsl:template match="/CHAMPIONNAT/JOURNEE" mode="sommaire">
<li>
</xsl:template><a href="#{@NUMERO}">
</li>journée <xsl:value-of select="@NUMERO" />
</a><xsl:template match="/CHAMPIONNAT/JOURNEE">
<h2 id="{@NUMERO}">
Journée <xsl:value-of select="@NUMERO" />
</h2><table width="40%">
</xsl:template><xsl:apply-templates select="RENCONTRE" />
</table><xsl:template match="RENCONTRE">
</xsl:stylesheet><tr>
</xsl:template><xsl:choose>
</tr><xsl:when test="@SCORED > @SCOREE">
<th align="right">
<xsl:value-of select="@DOMICILE" />
</th><th>
<xsl:value-of select="@SCORED" />
</th><td>
<xsl:value-of select="@SCOREE" />
</td><td align="left">
</xsl:when><xsl:value-of select="@EXTERIEUR" />
</td><xsl:when test="@SCORED < @SCOREE">
<td align="right">
<xsl:value-of select="@DOMICILE" />
</td><td>
<xsl:value-of select="@SCORED" />
</td><th>
<xsl:value-of select="@SCOREE" />
</th><th align="left">
</xsl:when><xsl:value-of select="@EXTERIEUR" />
</th><xsl:otherwise>
</xsl:choose><td align="right">
<xsl:value-of select="@DOMICILE" />
</td><td>
<xsl:value-of select="@SCORED" />
</td><td>
<xsl:value-of select="@SCOREE" />
</td><td align="left">
</xsl:otherwise><xsl:value-of select="@EXTERIEUR" />
</td>