[XML-SIG] SAX Namespaces

Greg Stein gstein@lyra.org
Mon, 3 Jul 2000 20:24:58 -0700


Each of these presumes that the namespace processing can be turned off. Is
that an important/required feature? IMO, the NS processing can/should always
occur; they are an integral part of XML processing today. The presence of
namespaces doesn't impact older documents either.

[ well, there is the case of somebody using ':' in an XML element name but
  NOT using namespaces. but holy smokes... I don't think we should introduce
  variations in our APIs based on this edge case. ]

[ nit: how is #5 different from #4? ]

I would take option (1) or (3). qname would be the prefix used. If NS
processing *can* be disabled, then uri==None and name==qname.

Cheers,
-g

On Mon, Jul 03, 2000 at 09:14:38PM -0500, Paul Prescod wrote:
> Greg:
> > Can somebody enumerate each of the options here so that we can restart the
> > discussion?
> 
> These are the ones I can keep track of:
> 
> #1. def startElement( self, (uri, name), qname, attrs ):
> 	....
> 
> Question 1: what should uri, name and qname get when namespace
> processing is off?
> Question 2: qname or prefix
> 
> #2. def startElement( self, (uri,localname,qname), attrs ):
> 	....
> 
> Same questions
> 
> #3. def startElement( self, ((uri, localname), qname), atrs ):
> 	....
> 
> Same questions.
> 
> #4. def startElement( self, name, attrs ):
> 	....
> 
> Depending on whether you have turned on namespace processing, "name" is
> either "string" or (uri,localname,qname)
> 
> Question: qname or prefix
> 
> #5. def startElement( self, name, atrs ):
> 	....
> 
> Same description and questions as above.
> 
> ----
> 
> At this point, I don't care enough to argue anymore.
> 
> I think that #4. is nicely backwards compatible, doesn't put namespaces
> stuff in people's faces unless they ask for it and will be a little more
> efficient in the common case where SAX is used as a means to an end like
> DOM, Pyxie, qp_xml or whatever. I think that having a tuple-format is
> even more useful (and efficient) when you are trying to pass attribute
> lists around.
> 
> -- 
>  Paul Prescod - Not encumbered by corporate consensus
> The calculus and the rich body of mathematical analysis to which it 
> gave rise made modern science possible, but it was the algorithm that 
> made the modern world possible.
> 	- The Advent of the Algorithm (pending), by David Berlinski
> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://www.python.org/mailman/listinfo/xml-sig

-- 
Greg Stein, http://www.lyra.org/