Reputation:
How do I get blip:picture
and blip:embedUrl
from the following XML:
<rss xmlns:blip="http://blip.tv/dtd/blip/1.0">
<channel>
<item>
<blip:picture>http://blip.tv/skin/blipnew/placeholder_user.gif</blip:picture>
<blip:embedUrl type="application/x-shockwave-flash">http://blip.tv/play/gvsIgeevJAI</blip:embedUrl>
</item
</channel>
</rss>
The full XML feed is here:
Solution:
$xml = new SimpleXMLElement($result);
$thumbnail = $xml->xpath('channel/item/blip:picture');
$thumbnail = $thumbnail[0];
Upvotes: 0
Views: 283
Reputation: 4796
$xml is a SimpleXMLElement, and you can use the xpath function to retrieve your information.
$picture = $xml->xpath('item/blip:picture');
$embedUrl = $xml->xpath('item/blip:embedUrl');
Upvotes: 1
Reputation: 116180
[edit, in response to yours]
There is no such thing as custom tags in XML. Or actually, they all are custom elements. There are no fixed tags, unlike in XHTML, which is a special structure, describing HTML-specific elements in an XML structure.
Upvotes: 0