views:

294

answers:

2

Im trying to read an RSS feed from Flickr but it has some nodes which are not readable by Simple XML (media:thumbnail, author flickr:profile, ...)

How do I get round this?

Im trying to get the thumbnail by the way.

P.S. My head hurts when I look at the documentation for the DOM. So I'd like to avoid it as I dont want to learn.

A: 

You're dealing with a namespace? I think you need to use the ->children method.

$ns_dc = $item->children('http://namespace.org/');

Can you provide a snippet with the xml declaration?

meder
+2  A: 

The solution is explained in this nice article. You need the children() method for accessing XML elements which contain a namespace. This code snippet is quoted from the article:

$feed = simplexml_load_file('http://www.sitepoint.com/recent.rdf'); 
foreach ($feed->item as $item) { 
    $ns_dc = $item->children('http://purl.org/dc/elements/1.1/'); 
    echo $ns_dc->date; 
}
vog
You probably should have given a short summary.
Stefan Kendall
Done. Thanks for the hint!
vog