Forum: Ruby Ruby-Feed parser and relative URL references

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3abc449148446ebed56b842ec4871265?d=identicon&s=25 eduard (Guest)
on 2005-12-30 17:45
(Received via mailing list)
I am using Ruby-Feedparser and it works great, but when I try to parse a
feed in which description contains relative URL references, I get an
error:

(REXML::ParseException) "#<REXML::ParseException: Declarations can only
occur in the doctype declaration.\nLine: \nPosition: \nLast 80
unconsumed
characters:\n<![CDATA[<p>Filed under: <a href=\"
http://engadget.com/category/cellphones/\<http://e...
rel=\">\n/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:325:

Is there a workaround?

Thanks,
eduard
67cb6fef42a83929955ce5a5b3f33f6e?d=identicon&s=25 Jon Smirl (Guest)
on 2005-12-30 18:07
(Received via mailing list)
On 12/30/05, eduard <fishkei@gmail.com> wrote:
> I am using Ruby-Feedparser and it works great, but when I try to parse a
> feed in which description contains relative URL references, I get an error:
>
> (REXML::ParseException) "#<REXML::ParseException: Declarations can only
> occur in the doctype declaration.\nLine: \nPosition: \nLast 80 unconsumed
> characters:\n<![CDATA[<p>Filed under: <a href=\"
> http://engadget.com/category/cellphones/\<http://e...
> rel=\">\n/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:325:
>
> Is there a workaround?

That feed doesn't validate at http://www.feedvalidator.org/ but for
different reasons than your are experiencing.

People need to validate feeds and complain to the authors. If feed
validation gets out of control we will be back to the HTML mess.

http://googlereader.blogspot.com/2005/12/xml-error...
3abc449148446ebed56b842ec4871265?d=identicon&s=25 eduard (Guest)
on 2005-12-30 18:25
(Received via mailing list)
Thanks Jon,

I validated the feed with feedvalidator.org before posting the message
and
it  said:

"This feed is valid, but may cause problems for some users."  Obviously,
I
am one of those users.

I'll write email to engadget and tell them about the problem.

Thanks for your help,
eduard
67cb6fef42a83929955ce5a5b3f33f6e?d=identicon&s=25 Jon Smirl (Guest)
on 2005-12-30 19:59
(Received via mailing list)
Is this the feed you are using?

Source: http://engadget.com/category/cellphones/rss.xml
This feed does not validate.
      line 404, column 1805: Undefined named entity: hellip [help]
          ... <item><title>Watch movies on your phones&hellip; while
they&#039;re stil ...
It is missing the external entity declaration.

From your mail you are getting an error about a malformed CDATA
section but I can't find a feed with that error.

You can do basic checking just by putting the feed URL into Firefox
and see if it parses without error.
http://engadget.com/category/cellphones/rss.xml will give you an
error.
This topic is locked and can not be replied to.