From:             
Operating system: linux 2.6.24
PHP version:      5.3.2
Package:          DOM XML related
Bug Type:         Bug
Bug description:getLineNo always returns 0 when called from DOMText nodes

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 bug report at http://bugs.php.net/bug.php?id=51417&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=51417&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=51417&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=51417&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=51417&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51417&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=51417&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=51417&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=51417&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=51417&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=51417&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=51417&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=51417&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=51417&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=51417&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51417&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51417&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=51417&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=51417&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=51417&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=51417&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=51417&r=mysqlcfg

Reply via email to