[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] two column table with alternating row colors using xsl xml and css


Subject: Re: [xsl] two column table with alternating row colors using xsl xml and css
From: nicholse@xxxxxxxxxxxxxxxx
Date: Fri, 8 Aug 2003 02:55:32 -0700 (PDT)

Made some progress but still not there.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmp="http://www.filemaker.com/fmpdsoresult"
exclude-result-prefixes="fmp">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="fmp:FMPDSORESULT">
<STYLE>
<!-- this is just an example, you can change this to whatever you like -->
.r0 { background-color: silver; color: black; }
.r1 { color: gray; }
</STYLE>
<TABLE>
<TR><TD>col1</TD><TD>col2</TD></TR>
<xsl:for-each select="fmp:ROW">
<xsl:sort select="fmp:Co" />
<! if "see below">
<TR>
<TD class="r{position() mod 2}">
<xsl:value-of select="fmp:Co"/>
</TD>
<!><TD class="r{position() mod 2}">
<!existing><xsl:value-of select="ceiling(count(../fmp:ROW) div 2) +
position()"/>
</TD>
</TR>
<! end if>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>

<xsl:if test="position() &lt; ceiling(count(../fmp:ROW) div 2)"> this
gives an error why?
<TD class="r{position() + 1 mod 2}">why cant I use this to alternate the
row/column data colour?
<xsl:value-of select="../fmp:ROW[ceiling(count(../fmp:ROW) div 2) +
position()]:Co"/>the existing line gives me the row position of the data I
want in Co but this line returns an error. Why?
</xsl:if>

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



Current Thread