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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
| <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html>
<header>
<table border="0" style="width: 964px; border-collapse: collapse; margin-left: 15px; margin-top: 10px;">
<tr>
<td colspan="2" style="width: 75%; font-size: 24px; text-align: left; padding-right: 15px; font-weight: 600;">Tableau de bord</td>
<td colspan="3" style="width: auto; font-size: 14px; text-align: right; padding-left: 15px;"><span style="font-weight: 600;"><xsl:value-of select="/dashboard/header/date"/></span></td>
</tr>
<tr>
<td colspan="2" style="width: 75%; font-size: 22px; text-align: left; padding-right: 15px;"><span style="font-weight: 600;"><xsl:value-of select="/dashboard/header/company"/></span></td>
<td colspan="3" style="width: auto; font-size: 14px; text-align: right; padding-left: 15px;"><span style="font-weight: 600;"><xsl:value-of select="/dashboard/header/time"/></span></td>
</tr>
<tr>
<td colspan="2" style="width: 75%; font-size: 22px; text-align: left; padding-right: 15px;"><span style="font-weight: 600;"><xsl:value-of select="/dashboard/header/name"/></span></td>
<td colspan="3" style="width: auto; font-size: 14px; text-align: right; padding-left: 15px;"><span style="font-weight: 600;"><xsl:value-of select="/dashboard/header/from"/></span></td>
</tr>
</table>
</header>
<body style="background-image: none">
<table border="0" style="width: 964px; border-collapse: collapse;">
<xsl:apply-templates select="/dashboard/category" />
</table>
<br />
</body>
<footer>
<table border="0" style="width: 964px; border-collapse: collapse; margin-left: 10px; margin-top: 10px;">
<tr>
<td colspan="5" style="width: auto; font-size: 10px; padding-left: 15px;">Energy Logger est un service proposé par la société 3iDS Sarl (Genève - Suisse)</td>
</tr>
</table>
</footer>
</html>
</xsl:template>
<xsl:template match="category">
<table border="0" style="width: 964px; border-collapse: collapse; margin-left: 10px; margin-top: 20px;">
<tr style="background-color: white; border-width: 1px; border-color: black; box-shadow: 0px 0px 4px black;">
<!--<xsl:apply-templates select="category_banner" />-->
<xsl:apply-templates select="." mode="category_banner" />
<xsl:apply-templates select="category_name" />
<xsl:apply-templates select="category_typeofvalue" />
<xsl:apply-templates select="category_value" />
<xsl:apply-templates select="category_unit" />
</tr>
<tr>
<td colspan="4">
<xsl:apply-templates select="datatype" />
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="category" mode="category_banner">
<xsl:choose>
<xsl:when test="category_id = '1'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #FF0000;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '2'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #FF00FF;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '3'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #009900;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '4'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #00FF00;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '5'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #6CD7FF;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '6'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #FF8F20;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '7'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #011DA0;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '8'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #925710;</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">border-color: black; box-shadow: 0px 0px 4px black;</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="category_name">
<xsl:choose>
<xsl:when test="category_id = '1'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #FF0000;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '2'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #FF00FF;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '3'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #009900;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '4'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #00FF00;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '5'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #6CD7FF;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '6'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #FF8F20;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '7'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #011DA0;</xsl:attribute>
</xsl:when>
<xsl:when test="category_id = '8'">
<xsl:attribute name="style">border-color: #92CE05; box-shadow: 0px 0px 4px #925710;</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">border-color: black; box-shadow: 0px 0px 4px black;</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<td style="width: 395px; padding-left: 5px; padding-right: 0px; text-align: left; font-size: 22px; font-weight: 600; "><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="category_typeofvalue">
<td style="width: 300px; padding-left: 0px; padding-right: 20px; text-align: right; font-size: 16px; font-weight: 600; "><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="category_value">
<td style="width: 100px; padding-left: 0px; padding-right: 0px; text-align: center; font-size: 28px; font-weight: 600; background-color: white;"><xsl:value-of select="."/></td>
<xsl:apply-templates select="category_color" />
</xsl:template>
<xsl:template match="category_color">
<xsl:attribute name="style"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
<xsl:template match="category_unit">
<td style="width: 164px; padding-left: 5px; padding-right: 0px; text-align: center; font-size: 20px; font-weight: 600;"><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="datatype">
<table border="0" style="width: 963px; border-collapse: collapse; margin-top: 10px;">
<tr>
<xsl:apply-templates select="datatype_name" />
<xsl:apply-templates select="datatype_typeofvalue" />
<xsl:apply-templates select="datatype_value" />
<xsl:apply-templates select="datatype_unit" />
</tr>
</table>
<tr>
<td>
<xsl:apply-templates select="counter" />
</td>
</tr>
</xsl:template>
<xsl:template match="datatype_name">
<td style="width: 375px; padding-left: 25px; padding-right: 0px; text-align: left; font-size: 18px; font-weight: 600;"><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="datatype_typeofvalue">
<td style="width: 295px; padding-left: 5px; padding-right: 20px; text-align: right; font-size: 16px; font-weight: 200; "></td>
</xsl:template>
<xsl:template match="datatype_value">
<td style="width: 100px; padding-left: 0px; padding-right: 0px; text-align: center; font-size: 22px; font-weight: 600; background-color: border-width: 1px; border-color: black; box-shadow: 0px 0px 4px #808080;"><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="datatype_unit">
<td style="width: 158px; padding-left: 6px; padding-right: 0px; text-align: center; font-size: 20px; font-weight: 600; color: #808080"><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="counter">
<table border="0" style="width: 964px; border-collapse: collapse; margin-top: 10px;">
<tr>
<td style="width: 120px; padding-left: 45px; padding-right: 0px; text-align: left; font-size: 14px; font-weight: 500;">Compteur / Sonde</td>
<xsl:apply-templates select="counter_name" />
<xsl:apply-templates select="counter_value" />
<xsl:apply-templates select="counter_unit" />
</tr>
</table>
</xsl:template>
<xsl:template match="counter_name">
<td style="width: 503px; padding-left: 45px; padding-right: 20px; text-align: right; font-size: 14px; font-weight: 500;"><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="counter_value">
<td style="width: 100px; padding-left: 5px; padding-right: 0px; text-align: center; font-size: 18px; font-weight: 600; background-color: white; color: #111; border-width: 1px; border-color: black; box-shadow: 0px 0px 4px #808080;"><xsl:value-of select="."/></td>
</xsl:template>
<xsl:template match="counter_unit">
<td style="width: 166px; padding-left: 5px; padding-right: 0px; text-align: center; font-size: 20px; font-weight: 600; "></td>
</xsl:template>
</xsl:stylesheet> |
Partager