qrss
qrss copied to clipboard
Get information from namespace
Hello,
If a RSS feed contains elements with namespace (see below), what is the way to get informations like content:encoded or dc:xxx in JSON?
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>feed title</title>
<image>
<url>http://www.xxxxx.com/images/logo.gif?v1.0</url>
<title>feed image title</title>
<link>http://www.xxxxx.com/</link>
</image>
<link>http://www.xxxxx.com/</link>
<description>feed description</description>
<language>en-us</language>
<dc:creator>feed creator</dc:creator>
<item>
<link>http://www.xxxxx.com/aaaa/test-1234567890</link>
<guid>http://www.xxxxx.com/aaaa/test-1234567890</guid>
<title>item title</title>
<pubDate>Thu, 31 Aug 2017 00:00:00 GMT</pubDate>
<dc:language>en-us</dc:language>
<dc:creator>item creator</dc:creator>
<description>item description</description>
<content:encoded>
<![CDATA[<h2>Test content</h2>
<p><img src="http://www.xxxxx.com/img/img_1.png" alt="..." title="..." style="float:left;margin:0 1em 1em 0;border:1px solid #000;" />
content ... content - <span style="color:#666">TEST</span><br /><strong style="color:#333">style test</strong>
</p>
<p style="clear:left">
<a href="http://www.xxxxx.com/aaa/bbb/test-1122334455666">More...</a>
</p>]]>
</content:encoded>
</item>
</channel>
</rss>
Do you think you could add it to your PHP class?
Thanks in advance and have a nice day.