[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jabber-jdev
Subject:    Re: [jdev] parsing xml (xmpp) with ruby
From:       "Eric Will" <rakaur () malkier ! net>
Date:       2008-10-02 16:25:58
Message-ID: 1ce38ef40810020925u6e319b79r8f8649cb67ef0c93 () mail ! gmail ! com
[Download RAW message or body]

On Wed, Oct 1, 2008 at 5:42 PM, Stephan Maka <stephan@spaceboyz.net> wrote:
> The parsers are fine. However, staying with one parser and keeping your
> own state per-stream is wrong. Keep one push parser per stream and let
> it care about the stream's state. Then just build the DOM with SAX
> events coming in.

When I was doing it a different way I was told that I need to use one
parser continuously. I can't win, apparently.

> As I already told you, this is perfectly doable with both
> REXML::Parsers::SAX2Parser and libxml-ruby's XML::Parser, the latter one
> in push mode with my recent patch to their list.

I'd like to figure it out with REXML. I am tired of changing to a
different parser every two hours only to be told I'm using the wrong
one by three different people. Ostensibly, there is more than one
"right way," but everyone thinks that theirs is the only way. I've
received a ton of conflicting "you have to do this" statements in this
thread, and I'm only running in circles. I don't know what a "push
parser" is, and Google seems mostly silent on the matter.

I don't see how this is doable in REXML if it raises exceptions on invalid XML.

> I'd be happy to repair your code if you finally shared it.

The code has been at http://svn.malkier.net/xmppd/ for two years.

If you can figure it out, thanks. The parsing is in
lib/xmppd/xmpp/parser.rb and lib/xmppd/xmpp/stream.rb

> Stephan

-- 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@jabber.org
_______________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic