def _resolve_prefix(celt, prefix):
    '''resolve prefix to a namespaceURI.  If None or 
    empty str, return default namespace or None.

    Parameters:
      celt -- element node
      prefix -- xmlns:prefix, or empty str or None
    '''
    namespace = None
    while _is_element(celt):
        if prefix:
            namespaceURI = _find_xmlns_prefix(celt, prefix)
        else:
            namespaceURI = _find_default_namespace(celt)
        if namespaceURI: break
        celt = celt.parentNode
    else:
        if prefix:  
            raise EvaluateException, 'cant resolve xmlns:%s' %prefix
    return namespaceURI
resolve prefix to a namespaceURI.  If None or 
    empty str, return default namespace or None.

    Parameters:
      celt -- element node
      prefix -- xmlns:prefix, or empty str or None