#19641 [Opn->Bgs]: test "position()mod 2" not being processed correctly

From: Date: Fri, 27 Sep 2002 22:20:46 +0000
Subject: #19641 [Opn->Bgs]: test "position()mod 2" not being processed correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-20603@lists.php.net to get a copy of this message
ID: 19641 Updated by: derick@php.net Reported By: tony@marston-home.demon.co.uk -Status: Open +Status: Bogus Bug Type: XSLT related Operating System: Windows XP PHP Version: 4.2.3 New Comment: If this is a bug at all, it's a bug in the libraries that PHP uses, which is libsablot (www.gingerall.com). Not a PHP problem -> bogus. Derick Previous Comments: ------------------------------------------------------------------------ [2002-09-27 16:23:47] tony@marston-home.demon.co.uk 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19641&edit=1

« previous php.bugs (#20603) next »