#42421 [NEW]: can not currently modify cdata node

From: Date: Sat, 25 Aug 2007 07:19:34 +0000
Subject: #42421 [NEW]: can not currently modify cdata node
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116654@lists.php.net to get a copy of this message
From: hejunbin at yahoo dot com dot cn Operating system: windows 2003 PHP version: 5.2.3 PHP Bug Type: SimpleXML related Bug description: can not currently modify cdata node Description: ------------ the simplexmlelement can not currently modify cdata node Reproduce code: --------------- <?php $xml_string = <<<EOD <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> <a> <b>b</b> <c><![CDATA[c]]></c> </a> EOD; $xml = simplexml_load_string($xml_string); $a = $xml->xpath('//a'); $a[0]-> b = B; $a[0]-> c = C; echo $xml-> saveXML(); ?> <a> <b>B</b> <c>C</c> </a> Expected result: ---------------- <?php $xml_string = <<<EOD <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> <a> <b>b</b> <c><![CDATA[c]]></c> </a> EOD; $xml = simplexml_load_string($xml_string); $a = $xml->xpath('//a'); $a[0]-> b = B; $a[0]-> c = C; echo $xml-> saveXML(); ?> <a> <b>B</b> <c><![CDATA[C]]</c> </a> -- Edit bug report at http://bugs.php.net/?id=42421&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42421&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42421&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42421&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42421&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42421&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42421&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42421&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42421&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42421&r=support Expected behavior: http://bugs.php.net/fix.php?id=42421&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42421&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42421&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42421&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42421&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42421&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42421&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42421&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42421&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42421&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42421&r=mysqlcfg

« previous php.bugs (#116654) next »