Subject: [xmpp] #29: handling of unsupported default namespace

From: "xmpp issue tracker" <[email-masked]>
Date: Mon, 14 Jun 2010 21:22:20 -0000

#29: handling of unsupported default namespace
--------------------------------+-------------------------------------------
 Reporter:  stpeter@…           |       Owner:  stpeter@…         
     Type:  defect              |      Status:  new               
 Priority:  major               |   Milestone:                    
Component:  3920bis             |     Version:                    
 Severity:  In WG Last Call     |    Keywords:                    
--------------------------------+-------------------------------------------
 Section 4.5.2 states:

 > If an entity receives a stream header with a default namespace
 > it does not support, it MUST return an <invalid-namespace/>
 > stream error.

 Waqas Hussain commented: "When using parsers in namespace aware mode,
 entities may not know anything about what the default namespace is.
 Parsers in namespace aware mode are only required to inform the
 application about namespaces associated with specific elements and
 attributes. Please don't forbid our use of Expat in namespace aware mode."

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/29>
xmpp <http://tools.ietf.org/xmpp/>

---

From: "xmpp issue tracker" <[email-masked]>
Date: Mon, 14 Jun 2010 21:25:31 -0000

Comment(by stpeter@…):

 Dave Cridland also commented on this section: "why historical reasons for
 not supporting something not defined in the specification...?"

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/29#comment:1>
xmpp <http://tools.ietf.org/xmpp/>

---

From: Peter Saint-Andre <[email-masked]>
Date: Sun, 27 Jun 2010 18:30:16 -0600

> #29: handling of unsupported default namespace

If I understand you correctly, you are saying that Expat (and perhaps
other parsers) in namespace aware mode can tell you that the namespace
for the <stream/> element is 'http://etherx.jabber.org/streams' or that
the namespace for <iq/> is 'jabber:client' but not that the default
namespace declared on the <stream/> element is 'jabber:client'. Correct?

If you can find another way to word these rules, I'd be happy to hear
about it.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

---

From: Peter Saint-Andre <[email-masked]>
Date: Mon, 28 Jun 2010 13:40:17 -0600

> namespace declared on the <stream/> element is 'jabber:client'. Correct?

While trying to rephrase that text, I realized that we could do things
like this (yes, I'm slow sometimes):

<stream xmlns='http://etherx.jabber.org/streams'>
  <message xmlns='jabber:client'>
    <body>foo</body>
  </message>
</stream>

... in which case there's no need to do strange things with prefixes and
default namespace vs. streams namespace.

Now let me see how I could rewrite the text to allow that (which does
seem reasonable, since it's simply "prefix-free canonicalization" and
therefore consistent with how we do everything else).

Peter

---

From: Peter Saint-Andre <[email-masked]>
Date: Mon, 28 Jun 2010 14:16:49 -0600

> therefore consistent with how we do everything else).

Cool. I'm not sure why I never saw this before -- it's amazing how
tradition can blind you to new ways of seeing things. :)

We can rewrite the text about default namespaces as follows:

###

4.5.2.  Default Namespace

   An entity MAY declare a default namespace for data sent over the
   stream.  If so, (1) the default namespace MUST be other than the
   streams namespace, and (2) the default namespace MUST be the same for
   the initial stream and the response stream so that both streams are
   qualified consistently.  The default namespace applies to all first-
   level child elements sent over the stream unless explicitly qualified
   by another namespace.

   Alternatively (i.e., instead of declaring a default namespace), an
   entity MAY explicitly qualify the namespace for each first-level
   child element of the stream, using so-called "prefix-free
   canonicalization".

   When a default namespace is declared, in rough outline a stream will
   look something like the following.

   <stream:stream
       from=[email-masked]'
       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>

   When a default namespace is not declared and so-called "prefix-free
   canonicalization" is used instead, in rough outline a stream will
   look something like the following.

   <stream
       from=[email-masked]'
       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:stream>

###

We might want to rephrase a few things in Section 4.5.5
(Mandatory-to-Implement Default Namespaces) but I don't think that's
strictly necessary.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

---

From: "xmpp issue tracker" <[email-masked]>
Date: Mon, 28 Jun 2010 20:22:54 -0000

#29: handling of unsupported default namespace
--------------------------------+-------------------------------------------
 Reporter:  stpeter@…           |        Owner:  stpeter@…         
     Type:  defect              |       Status:  closed            
 Priority:  major               |    Milestone:                    
Component:  3920bis             |      Version:                    
 Severity:  In WG Last Call     |   Resolution:  fixed             
 Keywords:                      |  
--------------------------------+-------------------------------------------
Changes (by stpeter@…):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 Provisionally resolved with this text:

 ###

 4.5.2.  Default Namespace

    <stream:stream

    <stream

 ###

-- 
Ticket URL: <http://trac.tools.ietf.org/wg/xmpp/trac/ticket/29#comment:2>
xmpp <http://tools.ietf.org/xmpp/>