AW: Re: [jdev] Namespace IRI handling when forwarding stanzas betw een c2s and s2s links
m at tthias.net
m at tthias.net
Wed Nov 30 08:49:10 CST 2005
It seems my last mail using webmail did not get through. Trying a small summary using my mobile phone.
Even if the namespace is normally only declared on the root element of the stanza or stream, it is also the namespace of all children with the same prefix until this prefix is redefined. So I have to change more than the namespace of the root.
I can also not just change the namespaces declared by the namespace declaration and make it dependant on where a new xmlns attribute is found as that would mean that I have to treat semantically equivalent XML documents differently.
-- Ursprüngl. Mitteil. --
Betreff: Re: [jdev] Namespace IRI handling when forwarding stanzas between c2s and s2s links
Von: "Norman Rasmussen" <norman at rasmussen.co.za>
Datum: 2005-11-30 13:53
Hrm, testing on an internal jabberd2, and then from jabberd2 to
ejabberd - the presence element keeps it's jabber:server namespace.
I think that when the stanza goes from s2s to c2s, and visa vera, you
should only be changing the namespace on the stanza's root node - and
not on all the subnodes inside the stanza too.
On 11/30/05, Matthias Wimmer <m at tthias.net> wrote:
> Hi!
>
>
> I am currently finishing namespace support for the next release of
> jabberd14. One remaining thing that is not completely clear to me is the
> handling of the different namespace IRIs on c2s- and s2s-links.
> Currently I am just mapping all three namespaces 'jabber:client',
> 'jabber:server', and 'jabber:component:accept' to the same jabberd14
> internal namespace. When I am serializing the stanzas, I check which
> type of connection the stanza is serialized on and use the standard
> namespace IRI for this type of connection.
>
> The problem I have with that is the following:
>
> Assume a client sends the following stanza:
>
> <message xmlns='jabber:client' from='user1 at example.com'
> to='user2 at example.com'>
> <body>Some example stanza, that is not very useful, but should
> demonstrate my problem</body>
> <x xmlns='http://example.com/someStrangeExtension'>
> <presence xmlns='jabber:server'/>
> </x>
> </message>
>
> This stanza gets delivered to user2 as:
>
> <message xmlns='jabber:client' from='user1 at example.com'
> to='user2 at example.com'>
> <body>Some example stanza, that is not very useful, but should
> demonstrate my problem</body>
> <x xmlns='http://example.com/someStrangeExtension'>
> <presence xmlns='jabber:client'/>
> </x>
> </message>
>
> (Note the namespace switch for the <presence/> element.)
> Is this namespace change allowed, or is this an error?
>
> In that simple case I could keep the namespace of the presence element
> intact very easily by just switching namespaces, when resending from one
> connection type to another. But it gets more complicated when user2 is
> on another server and I have to use s2s. In that case <message/> and
> <presence/> for sure are send as 'jabber:server' to the other server.
> But how does the other server know, that only the namespace of the
> <message/> element has to be mapped back to 'jabber:client' before delivery?
>
>
> Tot kijk
> Matthias
>
>
--
- Norman Rasmussen
- Email: norman at rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/
More information about the JDev
mailing list