Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XML/XSL Sequence Numbers >Thread Next - Re: XML/XSL Sequence Numbers Re: XML/XSL Sequence NumbersTo: NULL Date: 8/3/2006 12:22:00 PM Martin, Here's what I'm trying: <TR <xsl:if test="number(position() mod 2) > 0"> <xsl:text>class="alternateBg"</xsl:text> </xsl:if> > I'm not having any luck though. Martin Honnen wrote: > HugeBob wrote: > > > Usually you have some elements in the XML input that correspond to the > table rows, e.g. some item elements. When you process these with either > <xsd:for-each select="item"> > or > <xsl:apply-templates select="item"/> > to create the rows you can simply use the position function to check > whether it is an even or odd position > position() mod 2 = 0 > Use that test to generate an attribute for the background color or for > the corresponding style class. > > > > -- > > Martin Honnen > http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
