Subject: Re: [xsl] RE: Problem With Different Colors for Alternate Rows From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Tue, 05 Nov 2002 09:10:38 -0500 |
I was wondering if I can output the HTML as an XML file,
and then apply a second XSLT stylesheet on the HTML file that would loop through each row of the table and make alternativing rows different colors. Any ideas on how each of the two stylesheets should look like would be appreciated.
<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="node()|@*"> <!--identity transform--> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
<xsl:template match="tr[ position() mod 2 = 0 ]"> <xsl:copy> <xsl:attribute name="style">background:silver</xsl:attribute> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
<xsl:template match="tr[ position() mod 2 = 1 ]"> <xsl:copy> <xsl:attribute name="style">background:white</xsl:attribute> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
-- Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO: - North America: Feb 3 - Feb 7,2003
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-10-1 Practical Formatting Using XSL-FO Next conference training: 2002-12-08,03-03,06
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] RE: Problem With Different Co, Schwartz, Rechell R, | Thread | Re: Finding the closest node (was R, Peter Flynn |
AW: [xsl] expression must evaluate , "Braumüller, Hans" | Date | Re: AW: [xsl] expression must evalu, Oleg Tkachenko |
Month |