Quantcast
Channel: Active questions tagged feed+php+simplexml - Stack Overflow
Viewing all articles
Browse latest Browse all 16

simplexml_load_file(): http://website.com/feed:563: parser error : Entity 'nbsp' not defined

$
0
0

I'm trying to load XML data from a website, But I'm getting the following errors:

simplexml_load_file(): http://website.com/feed:563: parser error : Entity 'nbsp' not definedsimplexml_load_file(): 00f0i\u00f0, vi\u00f0 h\u00f6fum m\u00f3tteki\u00f0 \u00fea\u00f0.\r\n\r\n 

Here is the code:

$rss = simplexml_load_file('http://website.com/feed');foreach ($rss->channel->item as $item) {    $title = (string)trim(strip_tags($item->title));    $title = html_entity_decode($post['title']);    $description = (string)trim(strip_tags($item->description));}

I don't have access to edit the XML code, So how to solve this issue?

UPDATE: This is the 1st part of the RSS feed

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"    xmlns:content="http://purl.org/rss/1.0/modules/content/"    xmlns:wfw="http://wellformedweb.org/CommentAPI/"    xmlns:dc="http://purl.org/dc/elements/1.1/"    xmlns:atom="http://www.w3.org/2005/Atom"    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title></title><atom:link href="" rel="self" type="application/rss+xml" /><link></link><description></description><lastBuildDate>Wed, 24 Feb 2021 12:12:53 +0000</lastBuildDate><language>en-US</language><sy:updatePeriod>    hourly  </sy:updatePeriod><sy:updateFrequency>    1   </sy:updateFrequency><generator></generator><image><url></url><title></title><link></link><width>32</width><height>32</height></image> <item><title></title><link></link><dc:creator><![CDATA[]]></dc:creator><pubDate>Wed, 24 Feb 2021 11:00:20 +0000</pubDate><category><![CDATA[]]></category><guid isPermaLink="false"></guid><description><![CDATA[ [...]]]></description><content:encoded><![CDATA[<p></p><p></p><p><strong></strong></p><p> <a href=""></a></p>]]></content:encoded></item>

How to get the content from this code using PHP?


Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>