[xmppwg] Namespace with fixed prefix issues

Jer jer at jabber.org
Fri Oct 25 17:50:09 CDT 2002


The usage of namespaces in jabber, in particular the stream part, began 
about the same time that namespaces themselves originated (1999), and 
this is an unfortunate relic of the inexperience of those times.  There 
are two comments on this usage though, one that makes it not as bad as 
you describe, and one that can lead us in the right direction.

Although the ideology of XML Namespaces is one where you can mix 
different elements, our usage of it as a stream header on a tcp socket 
is one where no other namespace or element could show up and conflict.  
The spec requires that when you open up a tcp socket to 5222, you 
initiate it with a stream element in the stream namespace, so there can 
be no potential conflict (as defined in the current spec and 
implementations) with any other element.  The usage of any other prefix 
or element produces the same stream initialization error/failure.

So it's part of our legacy, and I don't like it either :)  Couldn't the 
spec require that the namespaces and prefixes are actually handled 
properly, but for compatibility reasons the "stream:" prefix should be 
used? If so, is it worth it?

Jer

On Friday, October 25, 2002, at 02:01 PM, Lisa Dusseault wrote:

>
> I've seen a bit of discussion relating to the "stream" namespace, but
> none considering the dangers of fixing the prefix to a specific string.
> It's my understanding of the XML Namespace specification that the
> purpose of a namespace is to avoid colliding element identifiers.  The
> purpose of prefixes is to reduce the cost of using namespaces, and a
> prefix should have only local significance. However, it seems that
> fixing prefixes to a specific short string significantly reduces the
> collision-avoidance benefit from namespaces.  The problem is that some
> other group defining XML elements or attributes could decided to fix
> their prefix to "stream" as well.
>
> To see why, imagine that a geology data XML schema defined the schema
> "http://www.geology.org/water/running/stream" to have the prefix
> "stream".  It would be impossible to put data from the geology schema 
> in
> a XMPP stream (either as a body, or as attributes or elements extending
> the stream itself) or vice versa because the prefixes would conflict.
>
> An algorithm constructing an XML document should normally be able to
> assign prefixes arbitrarily. So, it should be able to assign the prefix
> "stream" to the geology data, then if there is a need to embed xmpp
> schema data inside that, the algorithm could assign the prefix 
> "stream2"
> or "foo" to the xmpp streams namespace.  Alternatively, the algorithm
> should be able to assign the prefix "1" to the xmpp stream namespace,
> and the prefix "2" to the geology stream namespace.
>
> Lisa
>
>
> _______________________________________________
> xmppwg mailing list
> xmppwg at jabber.org
> http://jabber.org/cgi-bin/mailman/listinfo/xmppwg




More information about the xmppwg mailing list