Qt 4.8
|
The QDomImplementation class provides information about the features of the DOM implementation. More...
#include <qdom.h>
Public Types | |
enum | InvalidDataPolicy { AcceptInvalidChars = 0, DropInvalidChars, ReturnNullNode } |
This enum specifies what should be done when a factory function in QDomDocument is called with invalid data. More... | |
Public Functions | |
QDomDocument | createDocument (const QString &nsURI, const QString &qName, const QDomDocumentType &doctype) |
Creates a DOM document with the document type doctype. More... | |
QDomDocumentType | createDocumentType (const QString &qName, const QString &publicId, const QString &systemId) |
Creates a document type node for the name qName. More... | |
bool | hasFeature (const QString &feature, const QString &version) const |
The function returns true if QDom implements the requested version of a feature; otherwise returns false. More... | |
bool | isNull () |
Returns false if the object was created by QDomDocument::implementation(); otherwise returns true. More... | |
bool | operator!= (const QDomImplementation &) const |
Returns true if x and this DOM implementation object were created from different QDomDocuments; otherwise returns false. More... | |
QDomImplementation & | operator= (const QDomImplementation &) |
Assigns x to this DOM implementation. More... | |
bool | operator== (const QDomImplementation &) const |
Returns true if x and this DOM implementation object were created from the same QDomDocument; otherwise returns false. More... | |
QDomImplementation () | |
Constructs a QDomImplementation object. More... | |
QDomImplementation (const QDomImplementation &) | |
Constructs a copy of x. More... | |
~QDomImplementation () | |
Destroys the object and frees its resources. More... | |
Static Public Functions | |
static InvalidDataPolicy | invalidDataPolicy () |
Returns the invalid data policy, which specifies what should be done when a factory function in QDomDocument is passed invalid data. More... | |
static void | setInvalidDataPolicy (InvalidDataPolicy policy) |
Sets the invalid data policy, which specifies what should be done when a factory function in QDomDocument is passed invalid data. More... | |
Private Functions | |
QDomImplementation (QDomImplementationPrivate *) | |
Properties | |
QDomImplementationPrivate * | impl |
Friends | |
class | QDomDocument |
The QDomImplementation class provides information about the features of the DOM implementation.
This class describes the features that are supported by the DOM implementation. Currently the XML subset of DOM Level 1 and DOM Level 2 Core are supported.
Normally you will use the function QDomDocument::implementation() to get the implementation object.
You can create a new document type with createDocumentType() and a new document with createDocument().
For further information about the Document Object Model see Level 1 and Level 2 Core. For a more general introduction of the DOM implementation see the QDomDocument documentation.
The QDom classes have a few issues of nonconformance with the XML specifications that cannot be fixed in Qt 4 without breaking backward compatibility. The QtXmlPatterns module and the QXmlStreamReader and QXmlStreamWriter classes have a higher degree of a conformance.
This enum specifies what should be done when a factory function in QDomDocument is called with invalid data.
Enumerator | |
---|---|
AcceptInvalidChars | |
DropInvalidChars | |
ReturnNullNode |
QDomImplementation::QDomImplementation | ( | ) |
QDomImplementation::QDomImplementation | ( | const QDomImplementation & | x | ) |
QDomImplementation::~QDomImplementation | ( | ) |
|
private |
QDomDocument QDomImplementation::createDocument | ( | const QString & | nsURI, |
const QString & | qName, | ||
const QDomDocumentType & | doctype | ||
) |
Creates a DOM document with the document type doctype.
This function also adds a root element node with the qualified name qName and the namespace URI nsURI.
Definition at line 1071 of file qdom.cpp.
QDomDocumentType QDomImplementation::createDocumentType | ( | const QString & | qName, |
const QString & | publicId, | ||
const QString & | systemId | ||
) |
Creates a document type node for the name qName.
publicId specifies the public identifier of the external subset. If you specify an empty string (QString()) as the publicId, this means that the document type has no public identifier.
systemId specifies the system identifier of the external subset. If you specify an empty string as the systemId, this means that the document type has no system identifier.
Since you cannot have a public identifier without a system identifier, the public identifier is set to an empty string if there is no system identifier.
DOM level 2 does not support any other document type declaration features.
The only way you can use a document type that was created this way, is in combination with the createDocument() function to create a QDomDocument with this document type.
In the DOM specification, this is the only way to create a non-null document. For historical reasons, Qt also allows to create the document using the default empty constructor. The resulting document is null, but becomes non-null when a factory function, for example QDomDocument::createElement(), is called. The document also becomes non-null when setContent() is called.
Definition at line 1038 of file qdom.cpp.
The function returns true if QDom implements the requested version of a feature; otherwise returns false.
The currently supported features and their versions:
Feature | Version |
XML | 1.0 |
Definition at line 995 of file qdom.cpp.
Referenced by QDomNode::isSupported().
|
static |
Returns the invalid data policy, which specifies what should be done when a factory function in QDomDocument is passed invalid data.
Definition at line 1137 of file qdom.cpp.
bool QDomImplementation::isNull | ( | ) |
Returns false if the object was created by QDomDocument::implementation(); otherwise returns true.
Definition at line 1085 of file qdom.cpp.
bool QDomImplementation::operator!= | ( | const QDomImplementation & | x | ) | const |
QDomImplementation & QDomImplementation::operator= | ( | const QDomImplementation & | x | ) |
bool QDomImplementation::operator== | ( | const QDomImplementation & | x | ) | const |
Returns true if x and this DOM implementation object were created from the same QDomDocument; otherwise returns false.
Definition at line 962 of file qdom.cpp.
|
static |
Sets the invalid data policy, which specifies what should be done when a factory function in QDomDocument is passed invalid data.
The policy is set for all instances of QDomDocument which already exist and which will be created in the future.
Definition at line 1160 of file qdom.cpp.
|
friend |
|
private |
Definition at line 122 of file qdom.h.
Referenced by operator!=(), operator=(), operator==(), and QDomImplementation().