[XML-SIG] default namespace prefixes in xpath's processorNss

Joseph Reagle reagle@w3.org
Fri, 5 Apr 2002 11:34:33 -0500


I did a little more poking about with respect to my question of how to pass a 
defalut namespace value to the XPath evaluation via processorNss [1]. I 
didn't find any documentation or code that indicated there was a way 
(maybe I'm still missing it.) I also wondered whether such a think is 
even supposed to be possible; XPath says the context includes, "The 
namespace declarations consist of a mapping from prefixes to 
namespace URIs." [2] I presume a legitimate mapping includes the 
null prefix for the default namespace? Gregor, was this supported by your 
library, did you add it,have you seen other evidence of this? (Any other interop on 
those examples?) 

I also did some newbie tinkering [3] to Context.py with poor results. 
Something would have to be tweaked in the evaluation part as well 
but I'm not familiar enough with the code...



[1] http://mail.python.org/pipermail/xml-sig/2002-April/007527.html
[2] http://www.w3.org/TR/xpath#section-Introduction
[3] /usr/lib/python2.1/site-packages/_xmlplus/xpath/Context.py
        if self.processorNss.has_key('#default'): 
            defaultNS = self.processorNss['#default']
            del self.processorNss['#default']
            self.processorNss[''] = defaultNS