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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ss at contactsheet dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 06:01:32 2025 UTC