[XML-SIG] SAX namespaces discussion status

Uche Ogbuji uogbuji@fourthought.com
Tue, 04 Jul 2000 07:47:15 -0600


LMG:

> Paul listed four alternatives (the fifth seems to be identical with
> #4). Here is my, slightly modified, version of that list. The qname or
> prefix discussion we can leave for later, since it is really
> orthogonal to the name representation issue.
> 
>   #1. def startElement( self, (uri, name), qname, attrs ):
>       When namespace processing is off, (uri, name) is just the raw
>       name instead.
> 
>   #2. def startElement( self, (uri,localname, qname), attrs ):
> 
>   #3. def startElement( self, ((uri, localname), qname), atrs ):
> 
>   #4. def startElement( self, name, attrs ):
>       Depending on whether you have turned on namespace processing,
>       "name" is # either "string" or (uri,localname,qname)

There's one axis you left out: qname versus prefix.  IOW, there are another 
four options:

#5. def startElement( self, (uri, name), prefix, attrs ):

#6. def startElement( self, (uri,localname, prefix), attrs ):

#7. def startElement( self, ((uri, localname), prefix), atrs ):

#8. def startElement( self, name, attrs ):

with modes where name = "name" or (uri,localname,prefix)


I tend to side more with Greg on this matter: I'd rather have the prefix split 
out for me.  4XPath and 4XSLT are absolutely littered with SplitQName() calls 
that would be somewhat reduced in this case.

So deciding all over again, 5 and 8 both look attractive.  As Greg says, 8's 
modes can make genericizing SAX handlers (say for filters) tricky.  But on the 
other hand, there would have to be a raft of conditionals for processing 5 
generically.

In the end, though, my leaning would be towards 5.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +01 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python