[JDEV] namespaces in jabber server architecture
Thomas Charron
tcharron at ductape.net
Tue Jan 9 09:00:00 CST 2001
> I went through the code of jabber. In libxode, in implementing the
callbacks
> for expat parser(src/expat.c of libxode-1.2.tar), namespaces are not used
> anywhere but simply a tree type structure is created using the callbacks
> (correct me if I am wrong here). Also, while creating expat parser,
> XML_ParserCreate( ) is used and not XML_ParserCreateNS( ).
That is a very good question. In the case of Jabber, instead of using the
parsers abilty to handle namespaces, we used a home grown approach by simply
treating the xmlns as an attribute. Basically, the protocol only supports
the use of default namespaces, and not the use of prefixed namespaces. This
allows the xmlns to, quite simply, just be an attribute.
> Also, I wanted to know if namespaces are used for filtering some elements
> while parsing.
Not really a filter during parsing, but a flag during processing of the
message. Basically, an applications looks at the xmlns for tags that have
extention tags, message = x, iq = query, etc. In those tags, look at the
xmlns used, and figure out if you support them, or not..
More information about the JDev
mailing list