views:

86

answers:

0

Short of it is I am using a 3rd party library to parse some xmpp messages. It is giving me an instance of XmlPullParser to parse an atom syndicate feed entity myself. I'd like to use the apache Abdera project for this but the XmlPullParser un-encodes encoded characters (<, >, etc) this causes problems when I give the buffer to Abdera as it doesn't know what to do with html tags.

for instance the stream sends:

<content type='html'>This is a &lt;a href=&quot;http://google.com&amp;quot;&amp;gt;link&amp;lt;/a&amp;gt;&lt;/content&gt;

the XmlPullParser parses this into:

<content type='html'>This is a <a href="http://google.com"&gt;link&lt;/a&gt;&lt;/content&gt;

and when I put the buffer through Abdera it turns it in to:

This is a

The implementation of XmlPullParser that I have to work with is an instance of

org.xmlpull.mxp1.MXParser

which I can't change. So what I want to do is avoid buffering up the data coming out of the XmlPullParser and just convert the XmlPullParser to an XMLStreamReader (Which Abdera plays nice with). They seem very similar. Wondering if anyone is familiar with this already and has some pointers, hopefully a utility that already does it. Or a clever way around this.