Sure can James..
 
Try this
 
<xsl:for-each select="ROW">
<tr>
<xsl:if test="(position() mod 2) or (position()='1')">
<xsl:attribute name="class">RowBackgroundColourAlternate</xsl:attribute>
</xsl:if>

It's a rough starter - but you might be able to see where I'm going with it...
 
Brendan

________________________________

From: James Silva [mailto:[EMAIL PROTECTED]
Sent: Thu 27/11/03 3:15 PM
To: [EMAIL PROTECTED]
Subject: [WSG] [OT] XSL




Sorry if this is a little offtopic, but there are some cluey people on this
list so i thought i'd chance it.

Using ASP, i'm transforming some simple XML into a HTML table. Heres an
excerpt of the XSL file:

<xsl:for-each select="AriaCharts/Chart/ChartBody/Record">
<tr>
   <td><xsl:value-of select="column1"/></td>
   <td><xsl:value-of select="column2"/></td>
   <td><xsl:value-of select="column3"/></td>
</tr>
</xsl:for-each>

Now, after getting it all working, i've been informed by the graphics
department that we need alternating row background colours.

Basically, i need to run some kind of MOD() function to set a class for each
second <TR>.

Is this possible with XSLT? Or do i need to look at doing some pre/post
processing of my data using ASP?

p.s. keep in mind that this is my first attempt at transforming XML... so be
gentle :)

cheers,
____________________________
James Silva
Web Production
Gruden Pty Ltd

Tel:   +61 02 9956 6388
Fax:   +61 02 9956 8433
Email: [EMAIL PROTECTED]
Web:   http://www.gruden.com
____________________________

*****************************************************
The discussion list for http://webstandardsgroup.org/
*****************************************************



<<winmail.dat>>

Reply via email to