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
|
<table>
<xsl:call-templates name="alterner">
<xsl:with-param name="noeud" select="//host"/>
<xsl:with-param couleur select="0"/>
</xsl:call-templates>
</table>
......
<xsl:template name="alterner">
<xsl:param name="noeud" />
<xsl:param couleur select="0"/>
<xsl:variable name="atraiter" select="$noeud[1]"/>
<xsl:choose>
<xsl:otherwise>
<xsl:when test="$couleur<2">
<tr class="blanc">
<td>
<xsl:value-of select="ip" />
</td>
<td>
<xsl:value-of select="hostname" />
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr class="gris">
<td>
<xsl:value-of select="ip" />
</td>
<td>
<xsl:value-of select="hostname" />
</td>
</tr>
<xsl:otherwise>
</xsl:choose>
<xsl:if test="$noeud[position()>1]"/">
<xsl:when test="$couleur=3">
<xsl:call-templates name="alterner">
<xsl:with-param name="noeud" select="$noeud[position()>1]"/>
<xsl:with-param couleur select="0"/>
</xsl:call-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-templates name="alterner">
<xsl:with-param name="noeud" select="$noeud[position()>1]"/>
<xsl:with-param couleur select="$couleur+1"/>
</xsl:call-templates>
<xsl:otherwise>
</xsl:if>
</xsl:choose>
</xsl:template> |
Partager