[XML-SIG] SAX namespaces discussion status

Paul Prescod paul@prescod.net
Thu, 06 Jul 2000 11:18:33 -0500


Uche Ogbuji wrote:
> 
> 4XPath and 4XSLT are absolutely littered with SplitQName() calls
> that would be somewhat reduced in this case.

I claim that it is not SAX's fault that you need to do all of these
SplitQName's.

SAX can only force you to code two SplitQName calls: one for elements 
and one for attributes. Once you have the prefix you never lose it 
unless you throw it away!

The DOM does require you to do SplitQName() calls in createElementNS,
but SAX can't help you avoid those.

XSLT will also force you to do SplitQName when you see prefixes in
XPath select attribute values (not names). Once again, SAX won't 
help there.

Let's also consider the argument that gluing is easier than splitting.
The code for gluing looks something like:

if prefix:
	rawname=prefix+":"+localname
else:
	rawname=localname



The code for splitting is (something like):

pair=rawname.split( ":" )
if len( pair>1 ):
	prefix=pair[0]
else:
	prefix=""


Not a big difference in my mind.

-- 
 Paul Prescod - Not encumbered by corporate consensus