[jdev] parsing xml (xmpp) with ruby

Eric Will rakaur at malkier.net
Tue Sep 30 08:30:32 CDT 2008


On Mon, Sep 29, 2008 at 10:55 PM, Eric Will <rakaur at malkier.net> wrote:
> Okay, I implemented a SAX parser. It now goes through the tags until it gets
> to a partial one, and then raises an exception. The exception gives me zero
> information that I can use to cache the incomplete tag. REXML sucks.
>
> Kind of stuck at the moment.

Any of the XMPP4R guys out there? How do you handle this? I can't seem
to find it by drudging through your code. There's no reliable way to
reconstitute the original XML using REXML::Elements, so I can't build
a "this is how far we are" string and get the difference between that
and the original (by length). I can't use Regex#post_match for the
same reason. REXML::ParseException never sets ParseException#position
for me, so I have no idea how to get this to work. Does it have to do
with rexmlextensions.rb?

Thanks for any help.

-- rakaur



More information about the JDev mailing list