#31306 [Opn->Bgs]: textContent retrieves ALL cdata in children as well
| From: | rrichards@php.net | Date: | Mon, 27 Dec 2004 11:28:20 +0000 |
| Subject: | #31306 [Opn->Bgs]: textContent retrieves ALL cdata in children as well | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71115@lists.php.net to get a copy of this message | ||
ID: 31306
Updated by: rrichards@php.net
Reported By: js at enradia dot com
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: gentoo linux
PHP Version: 5.0.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Behavior is per the DOM specs:
http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent
Previous Comments:
------------------------------------------------------------------------
[2004-12-27 02:46:18] js at enradia dot com
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 this bug report at http://bugs.php.net/?id=31306&edit=1