Simple XML - handling colons in nodes
P粉713866425
2023-07-29 08:35:35
<p>I'm trying to read an RSS feed from Flickr, but it contains some nodes that Simple XML can't parse (like media:thumbnail, flickr:profile, etc.). <br /><br />How do I solve this problem? When I look at the documentation for the DOM, I get a headache. So I want to avoid using DOM because I don't want to learn it. <br /><br />By the way, I'm trying to get thumbnails. </p><p><br /></p>
In the latest version, you can now use curly braces to reference nodes with colons.
The solution is explained in this great article. You need to use the children() method to access the XML element containing the namespace. The following code snippet is taken from the article: