This email is to be read subject to the disclaimer below.

Hi James,

It's not OT (IMHO), XSL is a W3C standard. (whew, four acronyms in one
sentence...)

I have never used XSL -- yet... but I have looked at the docs before. And
something like this might just work:

<xsl:for-each select="AriaCharts/Chart/ChartBody/Record">
<xsl:if test="$ROW/2 = floor($ROW/2)">
<tr class="even">
</xsl:if>
<xsl:if test="$ROW/2 != floor($ROW/2)">
<tr class="odd">
</xsl:if>
   <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>

Replace $ROW with the correct row number -- perhaps a 'value-of'?

I have no idea if this will work or not so please let me know how you go
with it ;-)

Cheers,
Vik
----------------------
Viktor Radnai
Web Developer
Business Innovation Online
Ernst & Young Australia
http://www.eyware.com/
http://www.eyonline.com/
Direct: +612 9248 4361
Fax: +612 9248 4073
Mobile: +61408 662 546


                                                                                       
                                                
                       "James Silva"                                                   
                                                
                       <[EMAIL PROTECTED]         To:      <[EMAIL PROTECTED]>         
                                           
                       om>                     cc:                                     
                                                
                                               Subject: [WSG] [OT] XSL  [Virus 
checkedAU]                                              
                       27/11/2003                                                      
                                                
                       03:15 PM                                                        
                                                
                       Please respond                                                  
                                                
                       to wsg                                                          
                                                
                                                                                       
                                                
                                                                                       
                                                




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/
*****************************************************





--------------------
NOTICE - This communication contains information which is confidential and
the copyright of Ernst & Young or a third party.

If you are not the intended recipient of this communication please delete
and destroy all copies and telephone Ernst & Young on 1800 655 717
immediately. If you are the intended recipient of this communication you
should not copy, disclose  or distribute this communication without the
authority of Ernst & Young.

Any views expressed in this Communication are those of the individual
sender, except where the sender specifically states them to be the views of
Ernst & Young.

Except as required at law, Ernst & Young does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained nor
that the communication is free of errors, virus, interception or
interference.

Liability limited by the Accountants Scheme, approved under the
Professional Standards Act 1994 (NSW)
--------------------


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

Reply via email to