You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by Takasho <ta...@gmail.com> on 2007/09/05 17:02:36 UTC

Parsing errors using every example

Hi All,

I'm just trying to create a simple parser using the examples dotted around
the net and also from the examples provided. I'm building from the trunk and
its nice to see 0.30 shaping up so well.

Is RSS 2 support dropped from abdera as I can parse Atom 0.3 docs just fine
but when I parse RSS I get this error :

Exception in thread "main" java.lang.ClassCastException:
org.apache.abdera.parser.stax.FOMExtensibleElement cannot be cast to
org.apache.abdera.model.Feed
    at uk.co.orange.elmer.ParseFeed.main(ParseFeed.java:30)

The code I am using is:

Abdera abdera = new Abdera();
URL url = new URL("http://mylocalmachine.com/feeds/blog");
Parser parser = abdera.getParser();
InputStream in = url.openStream();
Document<Feed> doc = parser.parse(in);
Feed feed = doc.getRoot();

The feed is a standard RSS 2 feed and works fine in firefox et al.

I have separated the functions deliberately so that I can debug where the
error is and the line it dies on is the last one - Feed feed = doc.getRoot
();

Its probably something I've missed but I'm making up documentation as I'm
going along.

Takasho.

Re: Parsing errors using every example

Posted by James M Snell <ja...@gmail.com>.

Takasho wrote:
> Hi All,
> 
> I'm just trying to create a simple parser using the examples dotted around
> the net and also from the examples provided. I'm building from the trunk and
> its nice to see 0.30 shaping up so well.
> 
> Is RSS 2 support dropped from abdera as I can parse Atom 0.3 docs just fine
> but when I parse RSS I get this error :
> [snip]

There is as-yet incomplete RSS support in the contrib module in svn.
There is currently no build script for the module.  You'll need to
compile that code to get it working.

I will* eventually get around to completing that code and providing a
build script but there are currently no plans to make it part of the
default abdera distribution.

- James

*Of course, others are more than welcome to jump in and work on it :-)