[jdev] Mixing Attribute Namespaces

Dave Cridland dave at cridland.net
Wed Jan 14 03:39:24 CST 2009

On Wed Jan 14 09:20:11 2009, Richard Smith wrote:
> Hello,
> I've been having a think over the past few days and have been  
> wondering if
> applying namespaces on an attribute level is valid within XMPP, and  
> if there
> are any guidelines as to attribute specifications used.
> What I'm pondering is while the following is valid XML, is it valid  
> under XMPP?
> <message
>  to="..."
>  from="..."
>  xmlns:magicNS="urn:blah:etc"
>  magicNS:attr1="..." >...
> From what I understand in RFC3920 this would be ok, however mildly  
> confusing
> etc.
> Am I right in thinking that while this is valid, it's generally not  
> good for
> client understanding? Not that I care much in this context anyway  
> since I'm
> using XMPP as a transport protocol for something non-IM based, but  
> it's
> always good to know :)

Strictly, I think this is valid, however I'm not convinced that all  
servers would pass it through - my understanding is that stanza-level  
attributes are essentially reserved for hop-by-hop work. I'm not sure  
that's a hard and fast rule, but it certainly fits my experience.

On the other hand, putting namespaced elements (or attributes) inside  
a stanza will get passed through for certain, as well as being more a  
more traditional extension technique.

Dave Cridland - mailto:dave at cridland.net - xmpp:dwd at dave.cridland.net
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade

More information about the JDev mailing list