[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmpp] Use of namespace in RFC 3920



On Wed Sep 23 17:01:40 2009, Jehan Pagès wrote:
The RFC is clearly trying to make an excuse for badly programmed XML
parsers, not able to expand prefixes into namespaces (or keep track of
declared prefix in parent elements).

It's also opening the door for heavily optimized pathways which elide reserialization and all sorts.

 So you MUST absolutely have a
default namespace in the root <stream>, and this one MUST be the one
for the stanza ("jabber:client" or "jabber:server", most typically)

Right, this allows us to detirmine whether it's a client, server, or component. We actually do this - so if you want to, you can point clients, components, and servers alike at a single port and it'll all just work.

If we didn't do this, we'd need some additional signalling to distinguish, or else we'd have to use distinct TCP ports for all three, which seems suboptimal, especially when we're already using this quite happily.

 +
you MUST have a prefix declared, for the stream related first level
elements,

Well if you've already got a default namespace, it stands to reason you can't have the stream top-level elements in it.

 and this prefix MUST be "stream".

I don't care about this, and FWIW, we do not rely on it. Also, it's a SHOULD not a MUST, and a MAY rely on. The latter, I think, needs changing - this should be SHOULD (because of legacy systems) and MUST NOT rely on.


So for instance, the current RFC asks me to reject and consider this
stream start as an error, though it is perfectly valid XML and
conforming to XMPP:

<toto:stream
          from='juliet at im.example.com'
          to='im.example.com'
          version='1.0'
          xml:lang='en'
          xmlns='jabber:client'
          xmlns:toto='http://etherx.jabber.org/streams'>


No, the RFC says you MAY reject it. Section 11.2.1 says so.


And many other examples: for instance, if I prefer to use a declared
namespace for "jabber:client" instead of a default namespace, why
couldn't I?

See above. Various other things, like XEP-0220, get triggered by the default namespace choice of the initiator of the stream.

For historical reasons, some older implementations may accept only a
stream element qualification through a prefix named "stream" (and not
for instance through a default namespace, nor a prefix named other
than "stream"), declared in the initial <stream/> element. For
backwards compatibility, it may therefore be a good idea, though not
mandatory, to declare a prefix named "stream" and with value
"http://etherx.jabber.org/streams"; in the <stream/> header. However an
implementation MUST NOT send any error, hence reject a stream doing
differently, as long as the qualified names for the <stream/>,
<features/> and <error/> element are correct with this alternative
method.

"it may therefore be a good idea, though not mandatory" = SHOULD.

Dave.
--
Dave Cridland - mailto:dave at cridland.net - xmpp:dwd at dave.cridland.net
 - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
 - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade

Note Well: Messages sent to this mailing list are the opinions of the senders and do not imply endorsement by the IETF.