[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Different Colors for Alternating Rows

Subject: RE: Different Colors for Alternating Rows
From: Americo Albuquerque <melinor@xxxxxxx>
Date: Tue, 1 Jul 2003 18:42:22 +0100
xsl alternating rows
Hi

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Schwartz, Rechell R, ALABS
> Sent: Tuesday, July 01, 2003 1:36 PM
> To: kjjones@xxxxxxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Different Colors for Alternating Rows
> 
> 
> Kevin,
> 
> This time I didn't get the error and the performance was 
> excellent (only about 6 seconds), BUT every row came out with 
> the oddStyle. Any clue what is wrong?
> 

In your <xsl:template name='copytr'> change <xsl:when test="$even=true()">
to <xsl:when test="$even='true'"> and it might work (just in case you missed
the line I'm writing the complete template in the end of this email)

That happens because $even is bound to the value of a string attribute and
here you are comparing its value with true, so the result will always be
false and you'll get all oddStyle.


<xsl:template name='copytr'>
 <xsl:param name='node' select='.'/>
 <xsl:param name='inset'/>
 <xsl:param name='even'/>

 <xsl:for-each select='$node'>
  <xsl:copy>
   <xsl:choose>
    <xsl:when test="$inset">
    <xsl:choose>
     <!-- the next line has changed -->
     <xsl:when test="$even='true'">
     <td class="evenMedium" width="35%"><xsl:apply-templates
select="td[1]/node()|td[1]/@*"/></td>
     <td class="evenMedium" width="65%"><xsl:apply-templates
select="td[2]/node()|td[2]/@*"/></td>
     </xsl:when>
     <xsl:otherwise>
     <td class="oddMedium" width="35%"><xsl:apply-templates
select="td[1]/node()|td[1]/@*"/></td>
     <td class="oddMedium" width="65%"><xsl:apply-templates
select="td[2]/node()|td[2]/@*"/></td>
     </xsl:otherwise>
    </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
    <xsl:apply-templates select="node()|@*"/>
    </xsl:otherwise>
   </xsl:choose>
  </xsl:copy>
 </xsl:for-each>
</xsl:template>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.