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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC