[JDEV] Jabber's XML approach

Thomas Charron tcharron at ductape.net
Thu Jan 4 09:47:15 CST 2001


From: "Devendra Badhani" <deven at pspl.co.in>
Subject: [JDEV] Jabber's XML approach
>    I'm a newbie to the Jabber world. While going through the
> Jabber architecture I realised that, for obvious advantages,
> XML is being used for exchanging messages. I was curious to
> find out what mechanism is being used to translate the
> messages from one IM client format to another. I found mention
> of expat at quite a few places, hence the following queries :
> - Is jabber just using simple SAX/DOM parsing for achieving the
>   translation requirements?
> - Even if the requirement was for a simple SAX parser, was
>   there any special reason to use expat over the other parsers
>   like Xerces?

    Yes, due to the nature of the protocol, a SAX based parser is pretty
much required.  The protocol basically uses an XML 'Stream', which consists
of one XML document, instead of many.  When something is using the protocol,
they are basically dynamically 'writing' an ongoing XML document to the
socket, and reading the same.  Since a DOM based parser requires a complete
document to parse, it pretty much makes it unable to parse our stream.  It
requires the client respond to events, those events being top level tags.
Did I confuse you yet? :-)  Expat was used, as far as I know, simply becouse
that is the parser people used.  :-P  In many cases, such as I belive
JabberCOM, a Win32 COM object to handle Jabber communications written by
pgmillard, he used a home grown parser.  (Whap me if I'm wrong, pgmillard)..

> - Did you consider using XSL for message translation? I may be
>   wrong here(I am not very much into XML) XSL seems like an
>   obvious choice, though the XSL transformation is a costly
>   approach, but all the same it can give more felxibility as
>   the parsing/translation is out of the code into the XSLs.
>     I'll really appreciate if some of the gurus on the project can
> throw light on these queries.

    If you are speaking of the operation of transports, I think you may
misunderstand the mechanisms being utilized to connect to these foreign IM
systems.  Some transports serve as 'gateways' to other IM systems.  In some
cases, an XSL processor may due nicely.  Unfortionatly, none have been quite
so 'simple' as of yet.  All of the current transport gateways are
translating Jabber XML information into the native procotol used by the
external IM system.

    Using XSL has been talked about, but as of yet, no one has implemented
any schemes using XSL.





More information about the JDev mailing list