[XML-SIG] SAX namespaces discussion status

Paul Prescod paul@prescod.net
Tue, 04 Jul 2000 09:06:02 -0500


Lars Marius Garshol wrote:
> 
> ...
>
> As near as I can tell, these are Paul's arguments against it:
> 
>  - it breaks backwards compatibility
> 
>  - SAX convenience is not important
> 
>  - performance for higher layers

The other one, that I was not unclear about, is that a representation
that bundles the three parts gives us a clear and consistent path to a
low-level representation for attributes:

[(name, value), ...]

That's where the performance comes in.

> 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.

Oh geez are we going to break another book!

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.

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"

-- 
 Paul Prescod - Not encumbered by corporate consensus
The great era of mathematical physics is now over; the 300-year effort
to
represent the material world in mathematical terms has exhausted itself.
The
understanding it was to provide is infinitely closer than it was when
Isaac
Newton wrote in the late seventeenth centruy, but it is still infinitely
far
away.
	- The Advent of the Algorithm, by David Berlinski