Forum: Ruby on Rails Ruby Feedparser and exceptions on valid feeds

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.
eduard (Guest)
on 2006-02-28 05:45
(Received via mailing list)
I am using Ruby Feedparser and keep running into situations when a feed
is
valid but feedparser throws an exception - REXML::ParseException:
Declarations can only occur in the doctype declaration.

The following feed does validate at feedvalidator.org (with a warning,
but
does validate):
http://www.engadget.com/rss.xml

However, when I run feedparser I get this error:

<REXML::ParseException: Declarations can only occur in the doctype
declaration.
Line:
Position:
Last 80 unconsumed characters:
<![CDATA[<p>Filed under: <a
href="http://www.engadget.com/category/gaming/"
rel=">
/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:325:in `pull'
/usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:21:in `parse'
/usr/lib/ruby/1.8/rexml/document.rb:178:in `build'
/usr/lib/ruby/1.8/rexml/document.rb:45:in `initialize'
/home/eduard/rails/zaptxt/lib/feedparser/feedparser.rb:26:in `parse'
/home/eduard/rails/zaptxt/lib/feedparser/feedparser.rb:18:in
`initialize'

Any ideas what I can do?

Thanks,
eduard
This topic is locked and can not be replied to.