xsl:attribute

Création d'un attribut à un élément

xsl:attribute permet de créer un attribut.

Exemple

<xsl:apply-templates select="TARGETFIELD">
<BALISE>
<xsl:attribute name="ATTRIBUT1">
<xsl:value-of select="./BALISE1"/>
</xsl:attribute>
<xsl:attribute name="ATTRIBUT2">
<xsl:value-of select="./BALISE2"/>
</xsl:attribute>
</BALISE>
</xsl:apply-templates>

donnera :

<BALISE ATTRIBUT1="valeur-balise1" ATTRIBUT2="valeur-balise2"/>