NamespaceProvider
Overview
NamespaceProvider is a class in Aspose.PDF FOSS for Python.
Inherits from: XmpNamespaceProvider.
Resolve XMP namespace prefixes and URIs.
This class provides 8 methods for working with NamespaceProvider objects in Python programs.
Available methods include: __init__, get_namespace_uri, get_prefix, get_uri, items, prefixes, register, uris.
All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Methods
| Signature | Description |
|---|---|
get_namespace_uri(prefix: str) → str | None | Return the namespace URI bound to prefix, or None. |
__init__(namespaces: dict[str, str] | None, include_defaults: bool) | Calls init(namespaces, include_defaults) on this NamespaceProvider instance. |
register(prefix: str, uri: str) → XmpNamespaceProvider | Register a prefix <-> uri mapping. |
get_uri(prefix: str) → str | None | Return the namespace URI for prefix, or None if unknown. |
get_prefix(uri: str) → str | None | Return the prefix bound to uri, or None if unknown. |
prefixes() → list[str] | Return all registered prefixes. |
uris() → list[str] | Return all registered URIs. |
items() → list[tuple[str, str]] | Return all (prefix, uri) mappings. |