85
12
I noticed that when using SimpleXMLElement
on a document that contains those CDATA tags, the content is always NULL
. How do I fix this?
Also, sorry for spamming about XML here. I have been trying to get an XML based script to work for several hours now...
<content><![CDATA[Hello, world!]]></content>
I tried the first hit on Google if you search for "SimpleXMLElement cdata", but that didn't work.
How are you trying to access the node value? And, is SimpleXML a requirement? – allnightgrocery – 2010-06-03T23:58:17.950
I tried every other function (xml2array and all) that I could find on the web and SimpleXML seems to be the only one that gives GOOD results, except for the CDATA not working. – Angelo – 2010-06-04T00:02:49.407
1
We do a lot of XML parsing at work using DOMDocument (http://www.php.net/manual/en/class.domdocument.php). It works just fine in handling CDATA. Give that a short or post a little more code for us to see how you're working with SimpleXML.
– allnightgrocery – 2010-06-04T00:51:43.250