[jdev] parsing xml (xmpp) with ruby
Lucas Nussbaum
lucas at lucas-nussbaum.net
Tue Sep 30 17:22:46 CDT 2008
(Please Cc me, I don't follow jdev very closely)
On 30/09/08 at 09:30 -0400, Eric Will wrote:
> 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?
We don't deal with it, REXML does it for us by not pushing incomplete
events to us through the SAX2Parser.
See lib/xmpp4r/streamparser.rb
--
| Lucas Nussbaum
| lucas at lucas-nussbaum.net http://www.lucas-nussbaum.net/ |
| jabber: lucas at nussbaum.fr GPG: 1024D/023B3F4F |
More information about the JDev
mailing list