Edit report at http://bugs.php.net/bug.php?id=51417&edit=1

 ID:               51417
 Updated by:       [email protected]
 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

Reply via email to