I also find XMPP particularly difficult to parse.

In the case of a TLS connection, there's also the switch
from plain text to TLS...

I'm also coming to think that the best (or easiest) way
could be to use a SAX parser to parse out the stanzas, then
use a DOM parser for easy access to the attributes. However,
this may not handle the TLS's case though. I haven't looked
into the details but I suspect I need to handcraft the SAX
parser for the <stream> tags just to handle this scenario.

Jack

Saturday, September 27, 2008, 12:28:21 PM, you wrote:

> Hello World,

> I am writing an XMPP (Jabber) server in Ruby. XMPP uses XML for its
> protocol. This means I have to do a good deal of XML parsing, in Ruby.

> Right now I am using REXML to parse the individual stanzas as they
> come in. However, in order to do this without REXML complaining of
> "multiple root elements" (that is, XMPP is streaming XML over a TCP
> socket, so I only get the root element once) I have to wrap every
> incoming chunk of XMPP with my own <root/> tag, and then ignore that
> after REXML parses it. I am currently unhappy with this approach.



_______________________________________________
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: [EMAIL PROTECTED]
_______________________________________________

Reply via email to