NamespaceForURI(uri,
create_if_missing=False)
| source code
|
Given a URI, provide the Namespace instance corresponding to it.
This can only be used to lookup or create real namespaces. To create
absent namespaces, use CreateAbsentNamespace.
- Parameters:
uri (A non-empty str or unicode string) - The URI that identifies the namespace
create_if_missing (bool ) - If True , a namespace for the given URI is created if
one has not already been registered. Default is
False .
- Returns: Namespace or
None
- The Namespace corresponding to
uri , if available
- Raises:
|