def findNamespaceURI(self, prefix, node):
attrkey = (self.NS_XMLNS, prefix)<EOL>DOCUMENT_NODE = node.DOCUMENT_NODE<EOL>ELEMENT_NODE = node.ELEMENT_NODE<EOL>while <NUM_LIT:1>:<EOL><INDENT>if node is None:<EOL><INDENT>raise DOMException('<STR_LIT>' % prefix)<EOL><DEDENT>if node.nodeType != ELEMENT_NODE:<EOL><INDENT>node = node.parentNode<EOL>continue<EOL><DEDENT>result = node._attrsNS.get(attrkey, None)<EOL>if result is not None:<EOL><INDENT>return result.value<EOL><DEDENT>if hasattr(node, '<STR_LIT>'):<EOL><INDENT>raise DOMException('<STR_LIT>' % prefix)<EOL><DEDENT>node = node.parentNode<EOL>if node.nodeType == DOCUMENT_NODE:<EOL><INDENT>raise DOMException('<STR_LIT>' % prefix)<EOL><DEDENT><DEDENT>
Find a namespace uri given a prefix and a context node.