From: galg at sphera dot com
Operating system: Linux
PHP version: 4.3.10
PHP Bug Type: DOM XML related
Bug description: XML_CDATA_SECTION_NODE is returned as XML_TEXT_NODE
Description:
------------
When I've used the following code on php 4.3.8:
The <![CDATA[ ]> section was returned as XML_CDATA_SECTION_NODE (value
4).
When i am running the same code on 4.3.10 its returned as XML_TEXT_NODE
(value 3).
Reproduce code:
---------------
<?php
$sXML = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<XML_DOC>
<![CDATA[ something inside the CDATA. ]]>
</XML_DOC>
XML;
print_r(domxml_xmltree($sXML));
?>
Expected result:
----------------
php 4.3.8 response:
=======================
domdocument Object
(
[name] => #document
[url] =>
[version] => 1.0
[encoding] => UTF-8
[standalone] => -1
[type] => 9
[compression] => -1
[charset] => 1
[0] => 4
[1] => 138008952
[children] => Array
(
[0] => domelement Object
(
[type] => 1
[tagname] => XML_DOC
[0] => 5
[1] => 138009088
[children] => Array
(
[0] => domtext Object
(
[type] => 3
[name] => #text
[content] =>
[0] => 6
[1] => 138009160
)
[1] => domcdata Object
(
[type] => 4
[content] => something inside the
CDATA.
[0] => 7
[1] => 138009320
)
[2] => domtext Object
(
[type] => 3
[name] => #text
[content] =>
[0] => 8
[1] => 138009416
)
)
)
)
)
Actual result:
--------------
php 4.3.10 response:
===========================
domdocument Object
(
[name] => #document
[url] =>
[version] => 1.0
[encoding] => UTF-8
[standalone] => -1
[type] => 9
[compression] => -1
[charset] => 1
[0] => 4
[1] => 138267176
[children] => Array
(
[0] => domelement Object
(
[type] => 1
[tagname] => XML_DOC
[0] => 5
[1] => 138267304
[children] => Array
(
[0] => domtext Object
(
[type] => 3
[name] => #text
[content] =>
something inside the CDATA.
[0] => 6
[1] => 138258296
)
)
)
)
)
--
Edit bug report at http://bugs.php.net/?id=31779&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31779&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31779&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31779&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31779&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31779&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31779&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31779&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31779&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31779&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31779&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31779&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31779&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31779&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31779&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31779&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31779&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31779&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31779&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31779&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31779&r=mysqlcfg