From:             js at enradia dot com
Operating system: gentoo linux
PHP version:      5.0.3
PHP Bug Type:     DOM XML related
Bug description:  textContent retrieves ALL cdata in children as well

Description:
------------
using the method textContent on a node using teh php 5 DOM 
retrieves the cdata for every child as well - that doesn't 
seem right. it certainly is useless 

Reproduce code:
---------------
XML
--------------
<?xml version="1.0"  ?> 
<base> 
I see
    <item>   
       stuff 
    </item> 
    <item>   
       and
    </item> 
   <item>   
       more 
      <subitem>stuff</subitem>
    </item> 
    
</base> 

PHP
-----------
$root = $this->registry->getElementsByTagName('base');
       
        foreach($root as $node) { 
            print $node->textContent . " "; 
        } 

Expected result:
----------------
I see 

Actual result:
--------------
I see stuff and more stuff 

-- 
Edit bug report at http://bugs.php.net/?id=31306&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31306&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31306&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31306&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31306&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31306&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31306&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31306&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31306&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31306&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31306&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31306&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31306&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31306&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31306&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31306&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31306&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31306&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31306&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31306&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31306&r=mysqlcfg

Reply via email to