[jdev] Mixing Attribute Namespaces

Matthias Wimmer m at tthias.eu
Wed Jan 14 03:27:45 CST 2009


Hi Richard,

Richard Smith schrieb:
> <message
>  to="..."
>  from="..."
>  xmlns:magicNS="urn:blah:etc"
>  magicNS:attr1="..." >...

Why should it be bad? I don't see why it should be forbidden neither do 
I see where it should cause harm.

You should just keep in mind, that

<message xmlns='jabber:client' to='...' from='...'>...
and
<foo:message xmlns='jabber:client' to='...' from='...'>...

are from the pure XML point of view the same as a 'normal' stanza 
without the xmlns attribute,

while

<message xmlns:foo='jabber:client' foo:to='...' foo:from='...'>...
and
<foo:message xmlns:foo='jabber:client' foo:to='...' foo:from='...'>...

are not equivalent to the above to stanzas. I.e. an attribute name 
without a prefix does not denote an attribute in the default namespace, 
but an attribute that belongs to the element.


Matthias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3271 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://www.jabber.org/jdev/attachments/20090114/1ad81fc3/attachment-0003.bin>


More information about the JDev mailing list