[XML-SIG] SAX namespaces discussion status

Lars Marius Garshol larsga@garshol.priv.no
05 Jul 2000 17:37:26 +0200


* Lars Marius Garshol
|
| I don't think the backwards compatibility argument carries much
| weight.  Names have changed anyway, and in rewriting the code
| adapting the startElement / endElement methods is very little work.
| At least it was for me, and I've rewritten heaps of example code for
| my book for just this.

* Paul Prescod
| 
| Oh geez are we going to break another book!

Calm down, Paul, and read the paragraph again.  The book is already
broken twice, and I'm not trying to make it an issue in this
discussion.
 
| Anyhow, the more interesting backwards compatibility is between the
| namespaces and no-namespaces mode. You say:
| 
| > [non-namespace processing] makes XML much more approachable for novices,
| 
| and
| 
| > I would prefer replacing the tuple with the qname.  Any code that
| > looks at the internal structure of names for (uri, localname) will
| > assume namespace processing anyway, methinks. 
| 
| Now you've got all these handlers in novice mode like this:
| 
| def startElement( self, name, qname, attrs ):
| 	...
| 
| Where name is always equal to qname! That strikes me as confusing and
| unhelpful. If we are making a namespaces-off mode then you shouldn't
| have to think about namespaces.

Good point.

| I think that the most tenable compromise is working out to:
| 
| def startElement( self, name, attrs ):
| def startElement( self, ((uri, localname,), qname), attrs ):
| 
| where "qname" could be "qname" or "prefix"

I feel that this solution is better in non-namespace mode and worse in
namespace mode. It's acceptable to me, but I feel we should look a
little closer at the attributes issue. 

Which operations is it DOM/XPath/whatnot require efficient
implementations of in the Attributes interface? I'm asking not just
because I'd like to require that attrs above be an Attributes
instance, but also because I think the current Attributes design could
well be improved.

--Lars M.