1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <xsl:template match="TempPrincipal">
<Etudiant>
<xsl:copy-of select="@*[(name()!='NumEtudiant') and name()!='adresse')]" />
<xsl:choose>
<xsl:when test="not(@NumEtudiant) ">
<xsl:attribute name="NumEtudiant"><xsl:value-of select="'Le num n existe pas'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="NumEtudiant"><xsl:value-of select="@NumEtudiant" /></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@adresse='ville'">
<xsl:attribute name="adresse"><xsl:value-of select="'ville1'"/></xsl:attribute>
</xsl:when>
<xsl:when test="@adresse='numMaison'">
<xsl:attribute name="adresse"><xsl:value-of select="'123'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="adresse"><xsl:value-of select="@adresse" /></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</Etudiant>
</xsl:template> |