[standards-jig] A Question About Namespaces

Robert Norris rob at cataclysm.cx
Mon Apr 14 00:28:20 UTC 2003

> I'm unclear as to which of these, if any, is non-standard, according
> to XMPP core, section 7.6, first paragraph, i.e.,
>    "The child element MUST possess an 'xmlns' namespace declaration
>    (other than the stream namespace and the default namespace) that
>    defines all data contained within the child element."
> Does this require that the child element of a stanza must
> _specifically_ have an 'xmlns' attribute, or just that the child must
> have a different namespace?

This text sounds like the child element of <iq> should have its
namespace declared there. However, I don't see any reason why this
should be enforced,

> I can see why [3] would be kind of evil -- moving the <iq> stanza
> verbatim to another stream would require fixing up the namespace,
> although that's far from impossible for a good namespaces-aware
> XML writer.

It depends how you implement it. jabberd2, for example, processes
namespaces on the incoming stream by declaring the namespace in the DOM
the first time it is used (ie the first time an element or attribute in
that namespace appears), rather than when the namespace comes into
scope. This means that when written out the XML looks different to what
went in (and can potentially be larger), but it is semantically

> The only reason I see for excluding them is that so many extant Jabber
> processors are namespace-stupid (I know -- I maintain one :-) and
> equate "being in namespace X" with "having an 'xmlns' attribute equal
> to 'X'". Although, in real terms, that's a very good reason.

I think that any convention should say it should be done this way, but
the thought of making it a MUST in a standards document scares me.

> This isn't just more namespace bashing -- I'm honestly wondering if
> it's ever going to be worth my time and effort to upgrade my Jabber
> processor to really grok namespaces.

Do it - the more we have, the faster we get real namespace processing
adopted :)


Robert Norris                                       GPG: 1024D/FC18E6C2
Email+Jabber: rob at cataclysm.cx                Web: http://cataclysm.cx/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/standards/attachments/20030414/174bb26a/attachment.sig>

More information about the Standards mailing list