code: def _getPrefix(self, node, nsuri):
          '''
          Keyword arguments:
              node -- DOM Element Node
              nsuri -- namespace of attribute value
          '''
          try:
              if node and (node.nodeType == node.ELEMENT_NODE) and \
                  (nsuri == self._dom.findDefaultNS(node)):
                  return None
          except DOMException, ex:
              pass
          if nsuri == XMLNS.XML:
              return self._xml_prefix
          if node.nodeType == Node.ELEMENT_NODE:
              for attr in node.attributes.values():
                  if attr.namespaceURI == XMLNS.BASE \
                     and nsuri == attr.value:
                          return attr.localName
              else:
                  if node.parentNode:
                      return self._getPrefix(node.parentNode, nsuri)
          raise NamespaceError, 'namespaceURI "%s" is not defined' %nsurf _getPrefix(self, node, nsuri):
          '''
          Keyword arguments:
              node -- DOM Element Node
              nsuri -- namespace of attribute value
          '''
          try:
              if node and (node.nodeType == node.ELEMENT_NODE) and \
                  (nsuri == self._dom.findDefaultNS(node)):
                  return None
          except DOMException, ex:
              pass
          if nsuri == XMLNS.XML:
              return self._xml_prefix
          if node.nodeType == Node.ELEMENT_NODE:
              for attr in node.attributes.values():
                  if attr.namespaceURI == XMLNS.BASE \
                     and nsuri == attr.value:
                          return attr.localName
              else:
                  if node.parentNode:
                      return self._getPrefix(node.parentNode, nsuri)
          raise NamespaceError, 'namespaceURI "%s" is not defined' %nsuri
docs: Keyword arguments:
              node -- DOM Element Node
              nsuri -- namespace of attribute value