You can set the prefix for the current namespace with setPrefix(), and get the list of current prefixes (or those for a given URI) with prefixes(). The namespace URI is available from uri(). Use pushContext() to start a new namespace context, and popContext() to return to the previous namespace context. Use splitName() or processName() to split a name into its prefix and local name.
Normally, you should pop the context at the end of each XML element. After popping the context, all namespace prefix mappings that were previously in force are restored.
Returns one of the prefixes mapped to the namespace URI \fIuri\fR.
.PP
If more than one prefix is currently mapped to the same URI, this function makes an arbitrary selection; if you want all of the prefixes, use prefixes() instead.
.PP
Note: to check for a default prefix, use the uri() function with an argument of "".
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a list of all prefixes currently declared for the namespace URI \fIuri\fR.
.PP
The "xml:" prefix is included. If you only want one prefix that is mapped to the namespace URI, and you don't care which one you get, use the prefix() function instead.
.PP
Note: the empty (default) prefix is never included in this list; to check for the presence of a default namespace, use uri() with an argument of "".
.PP
Note that if you want to iterate over the list, you should iterate over a copy, e.g.
.PP
.nf
.br
QStringList list = myXmlNamespaceSupport.prefixes( "" );
This function stores the namespace URI in \fInsuri\fR (which will be set to TQString::null if the raw name has an undeclared prefix), and stores the local name (without prefix) in \fIlocalname\fR (which will be set to TQString::null if no namespace is in use).
Note that attribute names are processed differently than element names: an unprefixed element name gets the default namespace (if any), while an unprefixed element name does not.
Normally, you should push a new context at the beginning of each XML element: the new context automatically inherits the declarations of its parent context, and it also keeps track of which declarations were made within this context.
This function declares a prefix \fIpre\fR in the current namespace context to be the namespace URI \fIuri\fR. The prefix remains in force until this context is popped, unless it is shadowed in a descendant context.
.PP
Note that there is an asymmetry in this library. prefix() does not return the default "" prefix, even if you have declared one; to check for a default prefix, you must look it up explicitly using uri(). This asymmetry exists to make it easier to look up prefixes for attribute names, where the default prefix is not allowed.