Subject: Trying to learn XSL From: Tucker Williams <tucker@xxxxxxxxxxxx> Date: Thu, 24 Feb 2000 18:04:39 -0600 |
I'm trying to play around with some XSL. Someone else wrote this and I'm trying to figure out how to change it to my liking. What I want to do is for every other table cell after the table header have the colors of the table cell change every other cell. Here's what I have so far: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <html> <head><title>Incidents Currently Logged at Handango.com</title></head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="/*"> <table border='2'> <xsl:for-each select="*[position() = 1]/*"> <th bgcolor='GRAY'> <xsl:value-of select="local-name()"/> </th> </xsl:for-each> <xsl:apply-templates/> </table> </xsl:template> <xsl:template match="/*/*"> <tr> <xsl:apply-templates/> </tr> </xsl:template> <xsl:template match="/*/*/*"> <td bgcolor="slateblue"> <font color="wheat"> </font> </td> </xsl:template> </xsl:stylesheet> I'm wondering if I need a function to do this, something like: <xsl:choose> <xsl:when expr="[position() mod 2] =1"> some html </xsl:when> <xsl:when expr="[position() mod 2] =0"> some html </xsl:when> </xsl:choose> Am I on the right track? Or have I derailed? Any help is appreciated. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Variables..., Steve Tinney | Thread | Re: Trying to learn XSL, Juergen Hermann |
Variables..., Callum Elliott | Date | Re: Variables..., Steve Tinney |
Month |