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
|
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="Windows-1252" />
<xsl:template match="/">
<html>
<title>
</title>
<table>
<tr>
<xsl:call-template name="doublons">
<xsl:with-param name="noeud" select="//outil">
</xsl:with-param>
</xsl:call-template>
</tr>
</table>
<body>
</body>
</html>
</xsl:template>
<xsl:template name="doublons">
<xsl:param name="noeud" />
<xsl:param name="resultat" />
<xsl:variable name="valeur" select="$noeud[1]" />
<xsl:choose>
<xsl:when test="$noeud[@nom!=$valeur/@nom]">
<xsl:choose>
<xsl:when test="$resultat">
<xsl:call-template name="doublons">
<xsl:with-param name="noeud" select="$noeud[@nom!=$valeur/@nom]">
</xsl:with-param>
<xsl:with-param name="resultat" select="$resultat|$valeur">
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="doublons">
<xsl:with-param name="noeud" select="$noeud[@nom!=$valeur/@nom]">
</xsl:with-param>
<xsl:with-param name="resultat" select="$valeur">
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="affiche">
<xsl:with-param name="noeud" select="$resultat|$valeur">
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="affiche">
<xsl:param name="noeud" />
<tr>
<td>
<xsl:value-of select="$noeud[1]/@nom" />
</td>
<td>
<xsl:value-of select="$noeud[2]/@nom" />
</td>
<td>
<xsl:value-of select="$noeud[3]/@nom" />
</td>
</tr>
<xsl:if test = "$noeud[4]"> <xsl:call-template name="affiche">
<xsl:with-param name="noeud" select="$noeud[position()>3]">
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet> |