[xmppwg] Namespace with fixed prefix issues

Lisa Dusseault lisa at xythos.com
Fri Oct 25 14:01:38 CDT 2002


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





More information about the xmppwg mailing list