probleme variable xsl
Stéphane ANCELOT <[email protected]>
| Newsgroups | gmane.text.xml.french.tech |
|---|---|
| Message-ID | <[email protected]> |
Bonjour,
Je voudrais changer l'attribut stroke pour qu'il prenne des valeurs
differentes en fonction d'un no, mais ca ne marche pas !!!
Voici le code ci dessous , une idée ?
Steph
<xsl:template match="curve" mode="svg" >
<g xmlns="http://www.w3.org/2000/svg" id="curve{normalize-space(no)}">
<xsl:variable name="val" select="normalize-space(coord)"/>
<xsl:variable name="curvenr" select="normalize-space(no)"/>
<!--choix de la couleur = f(i) -->
<xsl:if test="$curvenr=1">
<xsl:variable name="color" select="'red'" />
</xsl:if>
<xsl:if test="$curvenr!=1">
<xsl:variable name="color" select="'yellow'" />
</xsl:if>
<polyline points="{$val}" style="stroke:{$color}; fill:
none;stroke-width: 2;"/>
</g>
</xsl:template>