REXML::ParseException - but the feed IS valid


#1

I am using Ruby feedparser and when I try to parse this feed:

http://feeds.feedburner.com/Mobilecrunch

I get an error:

REXML::ParseException: Declarations can only occur in the doctype
declaration.

This feed does validate at feedvalidator.org. Any idea why it would
raise
an exception?

Thanks,
eduard


#2

eduard wrote:

This feed does validate at feedvalidator.org
http://feedvalidator.org. Any idea why it would raise an exception?
Where’s the exception being raised? I can’t make REXML fail by hand on
that feed…


#3

It seems that it doesn’t like the <img tag. But I am not sure.

eduard

=======================
#<REXML::ParseException: Declarations can only occur in the doctype
declaration.
Line:
Position:
Last 80 unconsumed characters:

<![CDATA[

<img id=“image56” style=“float; right;” src="
http://mobilecrunch.com/>
/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:325:in pull' /usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:21:inparse’
/usr/lib/ruby/1.8/rexml/document.rb:178:in build' /usr/lib/ruby/1.8/rexml/document.rb:45:ininitialize’
/lib/feedparser/feedparser.rb:26:in
`parse’ /lib/feedparser/feedparser.rb:18:in


#4

I still have the same problem with Ruby 1.9.2…

===============================
I 05/17/2011 21:56:20:387 00001638 APP| Error:
#<REXML::ParseException: Declarations can only occur in the doctype
declaration.
Line: 39
Position: 2342
Last 80 unconsumed characters:

<![CDATA[

SDM Information Session will be held as follows.

Date: May>

The Atom Feed is valid: http://www.sdm.keio.ac.jp/en/atom.xml

Any idea?


#5

Sent from my iPhone

On May 17, 2011, at 8:02 AM, Thomas D. removed_email_address@domain.invalid wrote:

/>Date: May>

The Atom Feed is valid: http://www.sdm.keio.ac.jp/en/atom.xml

Any idea?

What’s on line 39 at position 2342 of the file?

B.