[Standards] XEP 297 xmlns and lang preservation in forwarding

Dave Cridland dave at cridland.net
Thu Aug 14 20:45:14 UTC 2014


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

> Maybe a reworded implementation approach...
>
> Copy stanza verbatim from the stream it was received on into <forwarded/>,
> replicate any applicable item from that stream which is, per normal XML
> processing, inherited by the stanza, by augmentation of the <forwarded/>
> element, such as by copying all namespace declarations and any xml:;lang
> attribute, to the <forwarded/> element and, if necessary, changing the
> prefix for the forwarded namespace so that it's distinct from those copied
> from that stream.
>
> The primary rationale for this approach is that allows verbatim copying of
> the stanza from the stream it was received on (or created in respect to)
> into a <forwarded/> element and avoids the need for deep inspection of the
> stanza to be forwarded.
>

With the exception of a theoretical case where the stream namespace has
been somehow used within a stanza, I think all you need to do is declare
the content namespace as the default namespace in the forwarded element,
and copy the xml:lang from the stream to the forwarded element.

If you're worried about the theoretical stream case, copy that one too. I
suspect that in most cases, you can rewrite the stanza tag itself without
concern, thus eliding any tautological declaration of the content namespace.

No other namespaces need to be copied; the only other one on the stream
header would be dialback; all others are illegal.

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


More information about the Standards mailing list