#31779 [Bgs->Opn]: XML_CDATA_SECTION_NODE is returned as XML_TEXT_NODE

From: Date: Sat, 05 Feb 2005 23:18:56 +0000
Subject: #31779 [Bgs->Opn]: XML_CDATA_SECTION_NODE is returned as XML_TEXT_NODE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73534@lists.php.net to get a copy of this message
ID: 31779 User updated by: galg at sphera dot com Reported By: galg at sphera dot com -Status: Bogus +Status: Open Bug Type: DOM XML related Operating System: Linux PHP Version: 4.3.10 New Comment: It's seems to be a problem with the integration of PHP 4.3.x and libxml2 ver 2.6.x. I've tested the following php5 script on PHP 5.0.2 compiled with libxml2-2.6.11 and it worked as expected: <?php $sXML = <<<XML <?xml version="1.0" encoding="UTF-8"?> <XML_DOC> <![CDATA[ something inside the CDATA. ]]> </XML_DOC> XML; $objXML = new DOMDocument; $objXML->loadXML($sXML); foreach ($objXML->documentElement->childNodes as $child) { echo "Type: " . $child->nodeType . "\t | \t"; echo "Name: " . $child->nodeName; echo "\n"; } ?> The php5 script returns good result: the CDATA section with type 4. Could it be that the problem is an API change in the libxml2 version 2.6.x which wasn't updated in version 4.3.x of php ? The result of the script on my environment is: Type: 3 | Name: #text Type: 4 | Name: #cdata-section Type: 3 | Name: #text Regards, Gal Previous Comments: ------------------------------------------------------------------------ [2005-02-05 16:24:26] johannes@php.net Please report this to the libxml2-people ------------------------------------------------------------------------ [2005-02-05 16:03:04] galg at sphera dot com Made 2 more tests: I've compiled php 4.3.10 with the latest libxml2 ver 2.6.17 and still has the same problem I tried also to compile it agains version libxml2-2.5.11 and it worked as expected. The problem seems to be only with version 2.6.x of libxml2. ------------------------------------------------------------------------ [2005-02-05 14:56:23] galg at sphera dot com I've compiled now the php myself: - I compiled php 4.3.10 with libxml2-2.4.30 the result was ok as i expected to be. - I compiled php 4.3.10 with libxml2 20611 the result was the same i wrote in the bug description. Latest version of libxml2 is :2.6.17. The sources files of the libxml2 are under directory called "old" all new Linux distributions are using libxml2 version 2.6.x. ------------------------------------------------------------------------ [2005-02-05 12:58:29] galg at sphera dot com I can compile it myself, but i am sure the results will be the same. I've saw this bug on 2 different systems Debian & Red Hat and there seem to be a problem with php and the latest libxml2. I'm sure you will be able to reproduce it on your environment with the sample code. If you want i will compile my version and update you. Regards, Gal ------------------------------------------------------------------------ [2005-02-05 02:06:17] sniper@php.net We don't support any binary packages. If you can't compile PHP yourself, you need to turn to the binary package provider. In this case RedHat and report the problem to them. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/31779 -- Edit this bug report at http://bugs.php.net/?id=31779&edit=1

« previous php.bugs (#73534) next »