xsl-list
[Top] [All Lists]

Re: xsl:variable with hex color values

2005-05-20 14:04:28
We centralize the choose logic in an attribute set and then just call that
attribute set from the td tag, replacing a css class on the different rows.
We do this on all of our tables and it works well for us.  Hope this helps.

<xsl:attribute-set name="bg1Tobg2">
              <xsl:attribute name="class">
                      <xsl:choose>
                              <xsl:when test="position() mod 2 =
0">bg_2</xsl:when>
                              <xsl:otherwise>bg_1</xsl:otherwise>
                      </xsl:choose>
              </xsl:attribute>
      </xsl:attribute-set>

<!--Your loop logic/apply-template and table here-->
                      <xsl:for-each>
                                      <td
xsl:use-attribute-sets="bg1Tobg2" align="right">
                                              <xsl:value-of
select="./Program" />
                                      </td>
                      </xsl:for-each>


or

<xsl:attribute-set name="bgcolor">
    <xsl:attribute name="class">bg<xsl:value-of select="position() mod 
2"/></xsl:attribute>
</xsl:attribute-set>

or

<td class="bg{position() mod 2}">




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--