Getting cdata content while parsing xml file

ANDerson

New Member
I have an xml file\[code\]<?xml version="1.0" encoding="utf-8"?><xml> <events date="01-10-2009" color="0x99CC00" selected="true"> <event> <title>You can use HTML and CSS</title> <description><![CDATA[This is the description ]]></description> </event> </events></xml>\[/code\]I used xpath and and xquery for parsing the xml.\[code\]$xml_str = file_get_contents('xmlfile');$xml = simplexml_load_string($xml_str);if(!empty($xml)){ $nodes = $xml->xpath('//xml/events');}\[/code\]i am getting the title properly, but iam not getting description.How i can get data insidethe cdataThanks in advance
 
Back
Top