If you use PHP with SimpleXml to parse xml you may run across a strange issue where SimpleXml fails to parse perfectly formatted xml. You'll likley get an error like this
Warning: simplexml_load_string() [function.simplexml-load-string]:
Entity: line 1: parser error : AttValue: " or ' expected
Chances are the PHP server has 'magic quotes' turned on. To get around the issue, add a strip slashes command to the xml string before parsing it. So your php would change from
$xml = simplexml_load_string($xmlstr); to
$xml = simplexml_load_string(stripslashes($page));Hope that helps someone, frustrating bug to track down.
Derrick Grigg is a Rich Internet Application (RIA) freelance contractor based in Toronto, Canada. He specializes in architecting and developing applications using a variety of technologies, most notably Flash, Flex and Coldfusion.
Jun 11, 2010 at 11:29 AM
Helped me! Thanks!
Jun 26, 2010 at 5:55 AM
Thanks Buddy...dis issue has wasted 6 hours of my time...
thankssss a lottttttttttttttttt :)