1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
| <?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="html"
encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
indent="yes" />
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Mon agenda</title>
</head>
<body>
<xsl:apply-templates match="/" />
</body>
</html>
</xsl:template>
<xsl:template match="agenda">
<table border="1">
<tr bgcolor="#0000FF">
<td width="120px">Lundi</td>
<td width="120px">Mardi</td>
<td width="120px">Mercredi</td>
<td width="120px">Jeudi</td>
<td width="120px">Vendredi</td>
</tr>
<xsl:apply-templates match="evenement" />
</table>
</xsl:template>
<xsl:template match="evenement">
<tr>
<td width="175px">
<xsl:call-template name="lundi" />
</td>
<td width="175px">
<xsl:call-template name="mardi" />
</td>
<td width="175px">
<xsl:call-template name="mercredi" />
</td>
<td width="175px">
<xsl:call-template name="jeudi" />
</td>
<td width="175px">
<xsl:call-template name="vendredi" />
</td>
</tr>
</xsl:template>
<xsl:template name="lundi">
<xsl:if test="jour = 'lundi'">
<xsl:call-template name="type" />
</xsl:if>
</xsl:template>
<xsl:template name="mardi">
<xsl:if test="jour = 'mardi'">
<xsl:call-template name="type" />
</xsl:if>
</xsl:template>
<xsl:template name="mercredi">
<xsl:if test="jour = 'mercredi'">
<xsl:call-template name="type" />
</xsl:if>
</xsl:template>
<xsl:template name="jeudi">
<xsl:if test="jour = 'jeudi'">
<xsl:call-template name="type" />
</xsl:if>
</xsl:template>
<xsl:template name="vendredi">
<xsl:if test="jour = 'vendredi'">
<xsl:call-template name="type" />
</xsl:if>
</xsl:template>
<xsl:template name="type">
<xsl:choose>
<xsl:when test="type='administratif'">
<td bgcolor="#FF0000">
<xsl:call-template name="toto" />
</td>
</xsl:when>
<xsl:when test="type='todo'">
<td bgcolor="#FF00FF">
<xsl:call-template name="toto" />
</td>
</xsl:when>
<xsl:when test="type='loisir'">
<td bgcolor="#00FF00">
<xsl:call-template name="toto" />
</td>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="toto">
<xsl:value-of select="titre"/><br />
<xsl:value-of select="lieu"/><br />
<xsl:value-of select="heure_debut"/> - <xsl:value-of select="heure_fin"/><br />
<xsl:value-of select="notes"/>
</xsl:template>
</xsl:stylesheet> |