[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jabber-jdev
Subject:    Re: [jdev] Application-specific payload in messages
From:       Matthias Wimmer <m () tthias ! eu>
Date:       2007-03-25 22:30:57
Message-ID: 4606F821.1050908 () tthias ! eu
[Download RAW message or body]

Hi!

hyperstruct - jdev schrieb:
> <message to="app@server.org">
>  <x xmlns="http://bar.org/protocol">
>    <foo/>
>  </x>
> </message>
> 
> <message to="app@server.org">
>  <foo xmlns="http://bar.org/protocol"/>
> </message>

Both is valid (in case the http://bar.org/protocol namespace knows an
<x/> element).

The first has been used in older protocols, as in the beginning of
Jabber it has been thought that the element containing an extension must
have the local name "x". This was because we did not do namespaces right
at the beginning.

But as the element having the xmlns declaration is already in the new
namespace, this was wrong. (As all these x elements are not part of the
Jabber namespace anyway.)

If you define your own namespace, you may define an "x" element in this
namespace. But in general or if you are using data in an existing
namespace, this namespace normally will not have an x element, so you
even have to use the later form.

So my suggestion would be to always use the later form for new extensions.


Matthias

-- 
Matthias Wimmer      Fon +49-700 77 00 77 70
Züricher Str. 243    Fax +49-89 95 89 91 56
81476 München        http://ma.tthias.eu/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic