[XML-SIG] SAX Namespaces

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


Back to startElement. I'm not entirely happy with any of the choices
before us. The status quo is probably not much better or worse than
anything else so we might as well leave it. That means:

def startElement( self, (URI, localname), rawname, value ):
	....

I propose a design goal: "Code that is namespace-unaware should work the
same whether namespaces are turned on or not." This allows an
incremental upgrade from namespace mode to non-namespace mode.

If we accept that goal, then rawname should be rawname, not prefix.
Namespace-oblivious code should work with the rawname and ignore the
"namespace name" parameter altogether. Making Expat live up to this
expectation could be a headache, but I think that it is useful. The
documentation should describe the rawname parameter as the appropriate
one for people uninterested in namespaces.

If you know about namespaces, and want to make code that works the same
in namespace mode or non-namespace mode, then you can match on the first
parameter, which would be either ("URI", "localname") or just "name". If
you don't care about namespace mode then you can just configure your
parser to always use namespaces and presume that the value is a tuple.
-- 
 Paul Prescod - Not encumbered by corporate consensus
The distinction between the real twentieth century (1914-1999) and the
calenderical one (1900-2000) is based on the convincing idea that the 
century's bouts of unprecented violence, both within nations and between 
them, possess a definite historical coherence -- that they constitute,
to 
put it simply, a single story. 
	- The Unfinished Twentieth Century, Jonathan Schell 
		Harper's Magazine, January 2000