def GetElementNSdict(self, elt):
d = self.ns_cache.get(id(elt))<EOL>if not d:<EOL><INDENT>if elt != self.dom: d = self.GetElementNSdict(elt.parentNode)<EOL>for a in _attrs(elt):<EOL><INDENT>if a.namespaceURI == XMLNS.BASE:<EOL><INDENT>if a.localName == "<STR_LIT>":<EOL><INDENT>d['<STR_LIT>'] = a.nodeValue<EOL><DEDENT>else:<EOL><INDENT>d[a.localName] = a.nodeValue<EOL><DEDENT><DEDENT><DEDENT>self.ns_cache[id(elt)] = d<EOL><DEDENT>return d.copy()<EOL>
Get a dictionary of all the namespace attributes for the indicated
        element.  The dictionaries are cached, and we recurse up the tree
        as necessary.