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
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:decimal-format name="fr" decimal-separator=',' grouping-separator=' ' />
<xsl:template match="ENFANTS"></xsl:template>
<xsl:template match="CONJOINTS"></xsl:template>
<xsl:template match="AFFECTERS"></xsl:template>
<xsl:template match="PROJETS"></xsl:template>
<xsl:template match="EMPLOYES">
<html>
<meta http-equiv="Content-Type"/>
<body>
<table border="1">
<tr>
<th>Nom</th>
<th>Prenom</th>
<th>No insee</th>
<th>Date de naissance</th>
<th>Salaire</th>
<th>Conjoint</th>
<th>Enfants</th>
<th>Affectations</th>
</tr>
<xsl:for-each select="EMPLOYE">
<xsl:sort order="ascending"/>
<tr>
<td><xsl:value-of select="NOM"/></td>
<td><xsl:value-of select="PRENOM"/></td>
<td>
<xsl:value-of select="substring(INSEE, 1, 1)"/>
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="substring(INSEE, 2, 2)"/>
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="substring(INSEE, 3, 2)"/>
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="substring(INSEE, 6, 2)"/>
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="substring(INSEE, 8, 3)"/>
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="substring(INSEE, 11, 3)"/>
</td>
<td>
<xsl:variable name="date_norm" select="DATENAISSANCE" />
<xsl:variable name="an" select="substring($date_norm, 1, 4)" />
<xsl:variable name="mois" select="substring($date_norm, 6, 2)" />
<xsl:variable name="jour" select="substring($date_norm, 9, 2)" />
<xsl:variable name="date_complete" select="concat($jour, '/', $mois, '/', $an)" />
<xsl:value-of select="$date_complete" />
</td>
<td>
<xsl:value-of select="format-number(SALAIRE div 6.55957, '# ###,00', 'fr')"/>
</td>
<td>
<xsl:choose>
<xsl:when test="//CONJOINT[REFEMPLOYECONJOINT = current()/@IDEMPLOYE]">
<xsl:value-of select="//CONJOINT[REFEMPLOYECONJOINT = current()/@IDEMPLOYE]/PRENOMCONJOINT"/>
<xsl:text> </xsl:text>
<xsl:value-of select="//CONJOINT[REFEMPLOYECONJOINT = current()/@IDEMPLOYE]/NOMCONJOINT"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Néant</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:for-each select="//ENFANTS/ENFANT[REFEMPLOYEENFANT = current()/@IDEMPLOYE]">
<xsl:sort order="ascending"/>
<xsl:value-of select="PRENOMENFANT"/>
<xsl:text> </xsl:text>
<xsl:value-of select="NOMENFANT"/>
<xsl:text> - </xsl:text>
<xsl:variable name="date_norm" select="DATENAISSANCEENFANT" />
<xsl:variable name="an" select="substring($date_norm, 1, 4)" />
<xsl:variable name="mois" select="substring($date_norm, 6, 2)" />
<xsl:variable name="jour" select="substring($date_norm, 9, 2)" />
<xsl:variable name="date_complete" select="concat($jour, '/', $mois, '/', $an)" />
<xsl:value-of select="$date_complete" />
<xsl:if test="position() != last()">
<xsl:text>,</xsl:text>
</xsl:if>
<br/>
</xsl:for-each>
</td>
<td>
<xsl:variable name="idEmpl" select="@IDEMPLOYE"/>
<xsl:for-each select="../../AFFECTERS/AFFECTER">
<xsl:variable name="refEmpl" select="REFEMPLOYE"/>
<xsl:variable name="refProj" select="REFPROJET"/>
<xsl:if test="$idEmpl=$refEmpl">
<xsl:for-each select="../../PROJETS/PROJET">
<xsl:if test="@IDPROJET=$refProj">
<xsl:value-of select="NOMPROJET"/>
</xsl:if>
</xsl:for-each>
<xsl:text disable-output-escaping="yes"> - </xsl:text>
<xsl:value-of select="TEMPSPOURCENTAGE"/>
<xsl:text disable-output-escaping="yes"> %</xsl:text>
<br/>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet> |
Partager