abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Beaulieu" <dbeaul...@moreover.com>
Subject RE: Using an existing parser
Date Mon, 19 Apr 2010 14:57:26 GMT
Hi dev, I am moving my discussion over to dev from user. Discussion
below.

I've attached a patch so that we can use abdera with our own
XMLStreamReader instance. 

 

I am using a 3rd party library to consume xmpp messages. Sometimes these
messages contain atom payloads. When they do, the 3rd party will hand
over an XmlPullParser instance (
http://www.xmlpull.org/v1/doc/api/org/xmlpull/v1/XmlPullParser.html) to
a custom self made consumer. I have no control over how the atom feed is
formed, and am not willing to stop using the 3rd party xmpp library.  At
this point I have built a wrapper around the XmlPullParser instance that
implements the XMLStreamReader interface. This is my patch to allow me
to do so. 

I'd like to get this patch applied, and if not some discussion as to
what I can change. I'd rather not have a fork of abdera to keep track
of. Thanks!

 

Dan

 

Also, I am not getting messages from user (and I suspect dev) mailing
lists. Nothing getting stuck in junk folder... I don't know if anyone
can look into that for me.

 

From: Dan Beaulieu 
Sent: Friday, April 16, 2010 3:36 PM
To: 'user@abdera.apache.org'
Subject: RE: Using an existing parser

 

Update: I've built an XMLStreamReader wrapper around an XmlPullParser
instance. I order to make this work I had to modify the Parser interface
and AbstractParser  in core to include constructors that take a
XMLStreamReader instance. I also had to modify the private constructor
in FOMParser to be public in order to get my XMLStreamReader instance in
there. It's obviously been designed like that but I'm not sure why. From
a 1000 foot view, if all of the various arguments end up being turned
into an XMLStreamReader anyway, we should be able to provide our own
instance. My solution bypasses the XMLInputFactory stuff as well, which
is probably the bigger problem. I'd like to either check in my changes
or work with someone to review my use case and figure something out.

Thanks.

 

Dan 

 

From: Dan Beaulieu 
Sent: Thursday, April 15, 2010 1:10 PM
To: 'user@abdera.apache.org'
Subject: Using an existing parser

 

Hi all, I am consuming an atom feed from a 3rf party library where they
are giving me an XmlPullParser. I'd like to be able to just feed that
parser instance to Abdera and have it build the abdera objects. For one
it'd be less work and two part of the xml spec, the XmlPullParser
un-encodes html characters. So things like &lt;br/&gt; become <br/>. So
I can't just buffer the data from the pull parser and give it to Abdera
because Abdera thinks it found xml, doesn't know what to do with the tag
<br/> tag and so I lose the data. 

 

It looks possible, but I'm coming up empty after cruising the source. 

 

I'm building from source from svn so I am the most up to date.

 

Thanks

 

Dan


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message