Bug #51417 [Opn->Bgs]: getLineNo always returns 0 when called from DOMText nodes
| From: | rrichards@php.net | Date: | Fri, 02 Apr 2010 10:13:38 +0000 |
| Subject: | Bug #51417 [Opn->Bgs]: getLineNo always returns 0 when called from DOMText nodes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149271@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51417&edit=1
ID: 51417
Updated by: rrichards@php.net
Reported by: ss at contactsheet dot org
Summary: getLineNo always returns 0 when called from DOMText
nodes
-Status: Open
+Status: Bogus
Type: Bug
Package: DOM XML related
Operating System: linux 2.6.24
PHP Version: 5.3.2
New Comment:
Not a PHP issue. You need to update libxml2 (2.7.0+) - was a bug in that
library
Previous Comments:
------------------------------------------------------------------------
[2010-03-28 07:26:22] ss at contactsheet dot org
Description:
------------
The getLineNo() method exists for DOMText but doesn't work correctly; it
always returns 0.
Test script:
---------------
<?php
$xml = <<<EOF
<foo>
<bar>baz</bar>
</foo>
EOF;
$doc = new DOMDocument();
$doc->loadXML( $xml );
$text = $doc->documentElement->firstChild->nextSibling->firstChild;
echo get_class( $text ) . ' : ' . $text->data . ' : ' .
$text->getLineNo() . "\n";
?>
Expected result:
----------------
DOMText : baz : 2
Actual result:
--------------
DOMText : baz : 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51417&edit=1