[XML-SIG] expat namespace_separator in Python 2.1

Fred L. Drake, Jr. fdrake@acm.org
Tue, 24 Apr 2001 10:31:05 -0400 (EDT)


"Daniel \"eikeon\" Krech" writes:
 > If we pass in None or omit it ends up parsing without namespaces, or at
 > least the names we are getting are of the form prefix:localname. We do want
 > namespaces, just with no separator between the namespace and the local name.
 >      [For <p:bar xmlns="foo"/> in our application (of the parser) we would
 > like to receive names in the form foobar. Passing in None yields p:bar]

  This sounds like it would be ambiguous -- consider:

       <foo xmlns="bat" xmlns:baz="ba">
         <baz:tfoo/>
       </foo>

would give you the elements batfoo and batfoo.
  Admittedly, this is a contrived example, and probably pretty
unusually in practice.  But it definately shows that using '' as the
separator is not workable in the general case -- you have to know that
your input is reasonable.  I can easily imagine somethng that
generated artificial namespaces coming up with XML that will be
problematic for this.
  I'm not particularly opposed to opening up the bindings to support
using '', though.  If that's the SIG's concensus, I'll be glad to do
it.  Backward compatibility is a nice quality!


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations