我有一些看起来像这样的 RSS:
<item>
<guid isPermaLink="false">2284767032</guid>
<title>title goes here...</title>
<description> Description </description>
<author>author name</author>
<dcterms:valid>start=2012-09-28T17:06:00Z;scheme=W3C-DTF</dcterms:valid>
<media:category scheme="" label="">cat1</media:category>
<media:category scheme="" label="">cat2</media:category>
<media:category scheme="" label="">cat3</media:category>
<media:copyright>Big Company</media:copyright>
<media:keywords>some;keywords;</media:keywords>
<media:group>
<media:content bitrate="643.386" medium="video" duration="72.144" expression="full" fileSize="5802051" framerate="29.97" type="video/x-flv" height="360" url="..." width="640"/>
<media:content bitrate="1242.571" medium="video" duration="72.144" expression="full" fileSize="11205501" framerate="29.97" type="video/x-flv" height="480" url="..." width="854"/>
</media:group>
<link>a234dfasf4f</link>
<plmedia:defaultThumbnailUrl>
http://url.jpg
</plmedia:defaultThumbnailUrl>
</item>
我正在使用以下代码来解析它:
$feed = simplexml_load_file('http://feedurl.com');
echo "<pre>";
print_r($feed);
echo "</pre>";
问题是我得到了所有的标签,比如guid 、 title 和 description,但是没有media:category
ormedia:group
或something:anything
出现 - 它们只是被剥离了。
如何在不丢失它们的情况下解析此提要?