Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/06/2008, 10:51
ZiCruz
 
Fecha de Ingreso: mayo-2004
Mensajes: 12
Antigüedad: 20 años
Puntos: 0
Pregunta Asignacion de variables en XSL

Hola a tod@s,

estoy intentado que cada fila salga de un color utilizando una variable tipo switch, pero no consigo modificar el valor inicial lo que tengo es esto:

<xsl:variable name="par">si</xsl:variable>
<xsl:for-each select="persona">
<xsl:sort select="apellidos/apellido1" data-type="text" order="ascending"/>
<xsl:choose>
<xsl:when test="$par='si'">
<tr bgcolor="cian">
<td><b><xsl:value-of select="$par"/></b></td>
<td><xsl:value-of select="apellidos/apellido1"/> <xsl:value-of select="apellidos/apellido2"/>, <xsl:value-of select="nombre"/></td>
<td><xsl:value-of select="municipio"/></td>
<td><xsl:value-of select="provincia"/></td>
</tr>
<xsl:variable name="par">no</xsl:variable>
</xsl:when>
<xsl:when test="$par='no'">
<tr bgcolor="yellow">
<td><b><xsl:value-of select="$par"/></b></td>
<td><xsl:value-of select="apellidos/apellido1"/> <xsl:value-of select="apellidos/apellido2"/>, <xsl:value-of select="nombre"/></td>
<td><xsl:value-of select="municipio"/></td>
<td><xsl:value-of select="provincia"/></td>
</tr>
<xsl:variable name="par">si</xsl:variable>
</xsl:when>
</xsl:choose>
</xsl:for-each>


¿¿¿Porque no funciona???

muchas gracias y un saludo.