[PATCH] compliance with section 9.2.3 of RFC 3920 (IQ Semantics)
Pedro Melo
melo at simplicidade.org
Wed Jan 17 14:22:44 UTC 2007
Hi,
On Jan 16, 2007, at 8:56 PM, Peter Saint-Andre wrote:
> Pedro Melo wrote:
>> Hi,
>> On Jan 13, 2007, at 12:50 PM, Martin Atkins wrote:
>>> Pedro Melo wrote:
>>>> Hi,
>>>> See http://rfc.net/rfc3920.html#s9. for reference, search for
>>>> 9.2.3.
>>>> Basically, to match an IQ with a semantic meaning, we must look
>>>> at the namespace and not at the tag the first child is using.
>>>> The relevant text of the RFC:
>>>> "The data content of the request and response is defined by
>>>> the namespace
>>>> declaration of a direct child element of the IQ element"
>>>> That means for example, that as long as I use xmlns='vcard-temp'
>>>> in the first child, the tag name can be vCard, query, or even
>>>> sometagnobodyneedstoknow.
>>>> The attached patch fixes the signature method of the IQ class,
>>>> and changes all the occurences of a set/get-{ns}tag I could find.
>>>
>>> Hmm.
>>>
>>> While I agree with you that the XMPP RFC section you referenced
>>> gives the impression that the element's local name is to be
>>> disregarded, I'm not convinced that this was the intention.
>> Well, when we question the intention, the better way to solve it
>> is to question the author :)
>> Peter, can you weight in on this? When matching IQ's, should we
>> just use the namespace or is the node name also relevant?
>
> The primary identifier is the namespace, by which we really mean
> the schema associated with the namespace. Naturally there may be
> different elements qualified by that namespace, which have
> different semantics, so IMHO it is probably most accurate to say:
>
> The data content of the request and response is defined by the
> schema or other structural definition associated with the XML
> namespace that qualifies the direct child element of the IQ
> element.
Ah, ok. So if someone for example sends:
<iq type="get" id="1" to="melo at simplicidade.org">
<query xmlns="vcard-temp" />
</iq>
the server should return not found, then? Because the vcard-temp
schema would say <vCard> must be used?
Thanks,
--
Pedro Melo
Blog: http://www.simplicidade.org/notes/
Jabber ID: melo at simplicidade.org
Use Jabber!
More information about the Djabberd
mailing list