[JDEV] namespaces in jabber server architecture

Shah Hitesh Bhavanji hitesh at pspl.co.in
Tue Jan 9 00:33:19 CST 2001


Hello Peter,

Thanks, for quick reply. I understood the motivation behind using
namespaces. However, I am still not sure if namespaces help in optimising
the parsing of XML stream. Or namespaces have nothing to do with parsing of
XML stream.

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( ).

Also, I wanted to know if namespaces are used for filtering some elements
while parsing.


Thanks and Regards,
Hitesh.



> Hello Hitesh,
>
> Jabber uses so many namespaces because the beauty of XML is that it is
> extensible. We can quickly add functionality using namespaces to handle
> specific kinds of information. For example, if you look at the
> namespaces used by Jabber (e.g., see
>
http://www.saint-andre.com/jabber/whitepaper/whitepaper.html#xml-namespaces)
> ,
> you'll see that we use namespaces to handle vCards, file transfers,
> client version queries, authentication, user database searching, contast
> list management, etc. Using namespaces for these kinds of data enables
> us to better manage this data by keeping track of which elements and
> attributes are related to each other. It also enables us to use the same
> element name in different namespaces if necessary (e.g, <item/> in the
> jabber:iq:roster namespace might mean something different from <item/>
> in the jabber:x:roster namespace).
>
> In general you can think of namespaces as a way to fully specify the
> meaning of a piece of information. If I tell you that I live in
> Manhattan, you might assume that I live in New York City. However, it
> might be that I live in Manhattan, Kansas or even Manhattan, Montana. We
> can think of the state here as something like a namespace which pins
> down the specific location of the town.
>
> Hope this helps.
>
> Peter
>
> --
> Peter Saint-Andre
> stpeter at jabber.org
>
> > Shah Hitesh Bhavanji wrote:
> >
> > Hi,
> > I was looking at the documents at www.jabber.org site. I could not
> > understand why so many namespaces are used in 'jabber' Server
> > Architecture. Does this help in optimising the parsing of XML
> > Document? If it does, then how? Is there any  other motivation for
> > keeping so many namespaces? I am new to XML and not very comfortable
> > with namespaces.
> >
> > Thanks and Regards,
> > Hitesh.
> >







More information about the JDev mailing list