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
| <?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="Windows-1252"/>
<xsl:template match="/">
<html>
<body>
<table>
<xsl:call-template name="doublon">
<xsl:with-param name="liste" select="racine/PERSONNE/ENTITE"/>
</xsl:call-template>
</table>
</body>
</html>
</xsl:template>
<xsl:template name="doublon">
<xsl:param name="liste"/>
<xsl:param name="result"/>
<xsl:variable name="valeur" select="$liste[1]"/>
<xsl:choose>
<xsl:when test="$liste[1]">
<xsl:choose>
<xsl:when test="not ($result)">
<xsl:call-template name="doublon">
<xsl:with-param name="liste" select="$liste[text()!=$valeur]"/>
<xsl:with-param name="result" select="$liste[1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="doublon">
<xsl:with-param name="liste" select="$liste[text()!=$valeur]"/>
<xsl:with-param name="result" select="$liste[1]|$result"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$result">
<xsl:sort select="."/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ENTITE">
<tr>
<td>
<xsl:value-of select="."/>
</td>
</tr>
<xsl:call-template name="doublon">
<xsl:with-param name="liste" select="../../PERSONNE[ENTITE=current()]/SERVICE"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="SERVICE">
<xsl:param name="truc" select="../ENTITE"/>
<tr>
<td>
</td>
<td>
<xsl:value-of select="."/>
</td>
</tr>
<xsl:call-template name="doublon">
<xsl:with-param name="liste" select="../../PERSONNE[ENTITE=$truc and SERVICE=current()]/NOM"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="NOM">
<tr>
<td>
</td>
<td>
</td>
<td>
<xsl:value-of select="."/>
</td>
<td>
<xsl:value-of select="../TEL"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet> |
Partager