[jdev] Re: Parsing XMPP/Jabber protocol

Mickael Remond mickael.remond at erlang-fr.org
Wed Dec 29 07:45:11 CST 2004

Maxym Gorodetskyy wrote:
> Alexey Nezhdanov wrote:
>>? ????????? ?? ????? 29 ??????? 2004 15:32 Maxym Gorodetskyy ???????(a):
>>>Hello there
>>>I have got one question:
>>>when server received from a client
>>><stream:stream to='my.host' xmlns='jabber:client'
>>>it is not getting  </stream:stream>.
>>>How  possible to parse this packet at this stage?
>>expat parsers allow that
> Well,  if I am using java?

To parse stream you need an event-based parser (SAX support) and not a 
tree based parser (like DOM), because a tree-based parser need to have 
the complete document to build the tree in memory.
Sax based parsing send events during parsing regarding opening/closing 
tags, contents, etc and can thus parse a stream (potentially infinite).

In Java, Xerces support both mode for example.

I hope this helps,

Mickaël Rémond

More information about the JDev mailing list