[jdev] parsing xml (xmpp) with ruby
Jonathan Dickinson
jonathan.dickinson at k2.com
Thu Oct 2 05:08:44 CDT 2008
Maybe it is something that is amiss in the Ruby world?
Why not try to get REXML to handle streaming XML? Throwing and catching exceptions on a server on a regular basis isn't the best idea (the same reason why we don't continually give ourselves papercuts and stick a plaster on them).
There *must* be a common point where it decides that the XML document is incomplete, maybe you can add fragment support there, instead of throwing an exception. I think the best idea would be to make a new type of XML node (e.g. IncompleteXmlNode) and return that.
Otherwise you will have to roll your own, which is only about a week of work: it's not *that* bad.
I will look at the code now and see if I can offer any insight.
> -----Original Message-----
> From: jdev-bounces at jabber.org [mailto:jdev-bounces at jabber.org] On
> Behalf Of Eric Will
> Sent: Wednesday, October 01, 2008 10:04 PM
> To: Jabber/XMPP software development list
> Subject: Re: [jdev] parsing xml (xmpp) with ruby
>
> On Wed, Oct 1, 2008 at 3:59 PM, Remko Tronçon <remko at el-tramo.be>
> wrote:
> > I don't know anything about REXML. Looking at the source code,
> there's
> > a bunch of parsers, but all of them call 'pull' somewhere, so that
> > makes me suspect that something's not right. The only people that can
> > help you are the other Ruby developers that did XMPP work, and I
> think
> > all of them already replied in this thread. Maybe you should look at
> > their code to see how they do it, and talk to them if you need help?
>
> XMPP4R is the only other Ruby project I can find out there. I asked
> what you use to see if I could find Ruby bindings for it. XMPP4R uses
> REXML, and as far as I can tell after looking through the code for an
> hour or so is that it does the same thing I do, and closes the stream
> when it gets an exception from REXML.
>
> > cheers,
> > Remko
>
> -- Eric Will // rakaur --
> _______________________________________________
> JDev mailing list
> FAQ: http://www.jabber.org/discussion-lists/jdev-faq
> Forum: http://www.jabberforum.org/forumdisplay.php?f=20
> Info: http://mail.jabber.org/mailman/listinfo/jdev
> Unsubscribe: JDev-unsubscribe at jabber.org
> _______________________________________________
More information about the JDev
mailing list