def registerNamespaceAlias(namespace_uri, alias):
 global registered_aliases
 if (registered_aliases.get(alias) == namespace_uri):
  return
 if (namespace_uri in registered_aliases.values()):
  raise NamespaceAliasRegistrationError, ('Namespace uri %r already registered' % (namespace_uri,))
 if (alias in registered_aliases):
  raise NamespaceAliasRegistrationError, ('Alias %r already registered' % (alias,))
 registered_aliases[alias] = namespace_uri

def registerNamespaceAlias ( namespace_uri , alias ) : global registered_aliases if ( registered_aliases . get ( alias ) == namespace_uri ) : return if ( namespace_uri in registered_aliases . values ( ) ) : raise NamespaceAliasRegistrationError , ( 'Namespace uri %r already registered' % ( namespace_uri , ) ) if ( alias in registered_aliases ) : raise NamespaceAliasRegistrationError , ( 'Alias %r already registered' % ( alias , ) ) registered_aliases [ alias ] = namespace_uri
registers a mapping in a global namespace alias map .