[Standards] XEP 297 xmlns and lang preservation in forwarding

Dave Cridland dave at cridland.net
Thu Aug 14 19:33:22 UTC 2014


On 14 August 2014 18:12, Kurt Zeilenga <kurt.zeilenga at isode.com> wrote:

> While XEP 298 does say:
>
>    1.
>
>    The namespace of the forwarded stanza MUST be preserved (this is
>    typically 'jabber:client'). If no 'xmlns' is set for the stanza then as per
>    XML namespacing rules it would inherit the 'urn:xmpp:forward:0' namespace,
>    which is wrong.
>
> This, by itself, is insufficient to ensure all relevant namespaces of the
> original stanza are preserved.  Any namespaces of the stream which the
> original message was received on, as well those of the original stanza need
> to preserved if used in the original stanza, need to preserved.    Also,
> lang tags should preserved.
>
>
I agree that we need to ensure that all relevant namespaces are preserved.
I'm in general agreement about xml:lang, but I'd note that servers should
really be preserving this on routing anyway, and don't.


> One way to do this is for the forwarded to copy all the name space
> declarations of the stream the original message was received into the
> forward element, use a prefix for the 'urn:xmpp:forward:0' which doesn't
> clash, and copy all prefixes of the original message with the original
> message, using the same prefixes as on the stream it was received on.
>

This seems rather ham-handed, and also restricted to implementations which
are aware of the prefixes used, and the namespaces declared. I also don't
think it's ever needed.


>
> So, for instance, if one received:
>
>    <stream:stream
>        from='juliet at im.example.com'
>        to='im.example.com'
>        version='1.0'
>        xml:lang='en'
>        xmlns='jabber:client'
>        xmlns:stream='http://etherx.jabber.org/streams'>
>      <message>
>        <body>foo</body>
>      </message>
>    </stream:stream>
>
>
>
> The element to be forwarded (inside a suitable message element) would be:
>
> <forwarded:forwarded xmlns:forwarded='urn:xmpp:forward:0
> xml:lang='en'
>
>        xmlns='jabber:client'
>        xmlns:stream='http://etherx.jabber.org/streams'>
>
>      <message>
>        <body>foo</body>
>      </message>
>
> </forwarded:forwarded>
>
>
Including the stream namespace here seems of no value.

If an implementation has declared other namespaces at the stream level -
and I vaguely recall some Blackberry client doing this - then the client is
wrong - RFC 6120 $4.8.5, last paragraph.


> Or if one received:
>
>    <stream
>        from='juliet at im.example.com'
>        to='im.example.com'
>        version='1.0'
>        xml:lang='en'
>        xmlns='http://etherx.jabber.org/streams'>
>      <message xmlns='jabber:client'>
>        <body>foo</body>
>      </message>
>    </stream>
>
>
>    <forwarded:forwarded xmlns:forwarded='urn:xmpp:forward:0'xml:lang='en'
>
>        xml:lang='en'
>
>        xmlns='http://etherx.jabber.org/streams'>
>
>      <message xmlns='jabber:client'>
>        <body>foo</body>
>      </message>
>
> </forwarded:forwarded>
>
>
>
No, the content namespace MUST be without prefix, and MUST be declared as
such in the stream header, so this is invalid too.

Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20140814/331b8026/attachment.html>


More information about the Standards mailing list