From:             [EMAIL PROTECTED]
Operating system: Windows XP
PHP version:      4.2.3
PHP Bug Type:     XSLT related
Bug description:  test "position()mod 2" not being processed correctly

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 bug report at http://bugs.php.net/?id=19641&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19641&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19641&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19641&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19641&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19641&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19641&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19641&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19641&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19641&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19641&r=globals

Reply via email to