tags:

views:

36

answers:

2

I am reading xml with this code.

$xml = simplexml_load_string($data);

it reads correctly, and can access to data via $xml->title etc. but i need to access to CDATA and <media:xxx> tags.

example of xml: pastie from: http://www.metacafe.com/api/item/4779040/

is possible to parse that data? how? sorry for my english! :)

+1  A: 

You need to look into SimpleXml and Namespaces

Try this - http://blog.sherifmansour.com/?p=302

jakenoble
+2  A: 
$xml = simplexml_load_string($data);
$namespacesMeta = $xml->getNamespaces(true);
$mediaXML = $xml->children($namespacesMeta['media']);
Mark Baker