note 69055 deleted from function.simplexml-load-file by bobby
| From: | bobby@php.net | Date: | Mon, 02 Oct 2006 20:53:59 +0000 |
| Subject: | note 69055 deleted from function.simplexml-load-file by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117964@lists.php.net to get a copy of this message | ||
Note Submitter: Ben Kimball
----
When the content of an element is a mix of elements and CDATA, it appears that SimpleXML only
returns the elements.
<content>
<item>foo</item>
<![CDATA[hello, this is some <bad>html</ba>]]>
<item>bar baz</item>
</content>
<?php
$xml = simplexml_load_file ('above.xml');
// no way to get $xml->content CDATA
?>
But:
<content>
<![CDATA[hello, this is some <bad>html</ba>]]>
</content>
<?php
$xml = simplexml_load_file ('above.xml');
echo $xml->content; // no problem
?>
Any ideas?
Ben