Hi!

hyperstruct - jdev schrieb:
> <message to="[EMAIL PROTECTED]">
>  <x xmlns="http://bar.org/protocol";>
>    <foo/>
>  </x>
> </message>
> 
> <message to="[EMAIL PROTECTED]">
>  <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/

Reply via email to