![]() |
| ||
Classes - Annotated - Tree - Functions - Home - Structure |
The QXmlNamespaceSupport class is a helper class for XML readers which want to include namespace support. More...
#include <qxml.h>
It provides some functions that makes it easy to handle namespaces. Its main use is for subclasses of QXmlReader which want to provide namespace support.
See also the namespace description.
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.
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 the prefixes() function instead.
Note: this function never returns the empty (default) prefix; to check for a default prefix, use the uri() function with an argument of "".
Note: if there is a default prefix, this function does not return it in the list; check for the default prefix using uri() with an argument of "".
Returns a list of all prefixes currently declared for the namespace URI uri.
The "xml:" prefix is included. If you want only one prefix that is mapped to the namespace URI, and you don't care which one you get, use the prefix() function instead.
Note: the empty (default) prefix is never included in this enumeration; to check for the presence of a default namespace, use uri() with an argument of "".
qname is the raw XML 1.0 name to be processed and isAttribute is a flag that specifies wheter the name is the name of an attribute (TRUE) or not (FALSE).
This function stores the return values the last two parameters as follows: It stores the namespace URI in nsuri and the local name (without prefix) in localname. If no namespace is in use, it stores a null string.
If the raw name has a prefix that has not been declared, then the return value is empty.
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 inherits automatically the declarations of its parent context, but it also keeps track of which declarations were made within this context.
Note that there is an asymmetry in this library: while prefix() does not return the default "" prefix, even if you have declared one; to check for a default prefix, you have to 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.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks | Qt version 3.0.0-beta2
|