#include <cxxtools/xml/namespacecontext.h>
Public Member Functions | |
| NamespaceContext () | |
| Creates a new NamespaceContext object which manages the namespaces of an XML document. | |
| ~NamespaceContext () | |
| Empty destructor. | |
| const String & | namespaceUri (const String &prefix) const |
| Returns the namespace URI of the namespace which has the prefix that is passed to this method. | |
| const String & | prefix (const String &namespaceUri) const |
| Returns the prefix for the namespace which has the URI that is passed to this method. | |
| void | addNamespace (const String &elementName, const Namespace &ns) |
| Associates the element name (elementName) with the given namespace (ns). | |
| void | removeNamespace (const String &elementName) |
| Removes the associates of the given element name (elementName) to the namespace. | |
To get the namespace URI for a prefix the method namespaceUri() can be used. To determine the prefix for a namespace the method prefix() can be used.
If no namespace with the given prefix exists, an empty String is returned.
| prefix | The namespace URI for the namespace with this prefix is returned. |
Referenced by StartElement::namespaceUri().
If no namespace with this URI exists, an empty String is returned.
| namespaceUri | The prefix of the namespace with this namespace URI is returned. |
The stored namespace can be retrieved by calling namespaceUri() or prefix(). To remove the association between the element name and namespace again, the method removeNamespace() can be used.
| elementName | Associates this element name with the also given namespace (ns). | |
| ns | Associates this namespace with the also given element name (elementName). |
| void removeNamespace | ( | const String & | elementName | ) |
| elementName | The associates for this element name is removed. |