• Viernes 29 de Marzo de 2024, 12:25

Autor Tema:  Asignación De Variables E Xsl  (Leído 2210 veces)

ZiCruz

  • Nuevo Miembro
  • *
  • Mensajes: 19
    • Ver Perfil
Asignación De Variables E Xsl
« en: Miércoles 4 de Junio de 2008, 18:58 »
0
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.