php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51417 getLineNo always returns 0 when called from DOMText nodes
Submitted: 2010-03-28 07:26 UTC Modified: 2010-04-02 12:13 UTC
From: ss at contactsheet dot org Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.3.2 OS: linux 2.6.24
Private report: No CVE-ID: None
 [2010-03-28 07:26 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-02 12:13 UTC] rrichards@php.net
-Status: Open +Status: Bogus
 [2010-04-02 12:13 UTC] rrichards@php.net
Not a PHP issue. You need to update libxml2 (2.7.0+) - was a bug in that library
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 04:01:23 2020 UTC