I am writing a distributed computing system based on Jabber, and have been building it from the ground up as I decided that no existing libraries quite suit my purpose. So I started writing an XML stream library on top of expat, and got it working just right. Namespaces work as specified by the W3C standards. But that's where my problems came in...
Jabber seems to treat namespace declarations as attributes, which they are not, despite appearances. Rather, the following are 100% equivalent: <?xml version='1.0'?> <stream xmlns='http://etherx.jabber.org/streams' to='host'> <whatever xmlns='jabber:x:whatever'/> </stream> --versus-- <?xml version='1.0'?> <stream:stream xmlns='jabber:x:whatever' xmlns:stream='http://etherx.jabber.org/streams to='host'> <whatever/> </stream:stream> However, unless you do: <?xml version='1.0'?> <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='host'> ... </stream:stream> for your opening tag, jabberd absolutely refuses to deal with it. Notice that the xmlns='jabber:client' is absolutely ineffectual except for any child elements with no namespace set, which basically doesn't occur ever from what I can tell of the protocol. Looking at the jabberd code, it does indeed treat these as xmlns and xmlns:stream attributes on the element. Can anyone explain the reasoning behind this method, or if a fix might be possible without severely injuring the Jabber server itself? I really don't want to have to redesign my project around an incorrect subset of the XML standard if I can avoid it. Thanks. -- Ari Johnson _______________________________________________ jdev mailing list [EMAIL PROTECTED] http://mailman.jabber.org/listinfo/jdev