|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-09-27 17:20 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 01:00:01 2025 UTC |
I have the following code in my XSL file: <tr><xsl:attribute name="class"> <xsl:choose> <xsl:when test="position()mod 2">odd</xsl:when> <xsl:otherwise>even</xsl:otherwise> </xsl:choose> </xsl:attribute> It's purpose is to set the class of the <tr> element depending on whether the row is odd-numbered or even-numbered so that the background colour can be set accordingly. This works perfectly with the MSXML parser, but with PHP the first row comes out as "odd" (correct), but all subsequent rows come out as "even". The only way I can get it to work is to modify the test to "position()mod 2-1", but this should not be necessary.