1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDomImplementation Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDomImplementation Class Reference<br /><sup><sup>[<a href="qtxml.html">QtXml</a> module]</sup></sup></h1><p>The QDomImplementation class provides information about the features of the DOM implementation. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a></b> { AcceptInvalidChars, DropInvalidChars, ReturnNullNode }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdomimplementation.html#QDomImplementation">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdomimplementation.html#QDomImplementation-2">__init__</a></b> (<i>self</i>, QDomImplementation)</li><li><div class="fn" />QDomDocument <b><a href="qdomimplementation.html#createDocument">createDocument</a></b> (<i>self</i>, QString, QString, QDomDocumentType)</li><li><div class="fn" />QDomDocumentType <b><a href="qdomimplementation.html#createDocumentType">createDocumentType</a></b> (<i>self</i>, QString, QString, QString)</li><li><div class="fn" />bool <b><a href="qdomimplementation.html#hasFeature">hasFeature</a></b> (<i>self</i>, QString, QString)</li><li><div class="fn" />bool <b><a href="qdomimplementation.html#isNull">isNull</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />InvalidDataPolicy <b><a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a></b> ()</li><li><div class="fn" /><b><a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a></b> (InvalidDataPolicy)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qdomimplementation.html#__eq__">__eq__</a></b> (<i>self</i>, QDomImplementation)</li><li><div class="fn" />bool <b><a href="qdomimplementation.html#__ne__">__ne__</a></b> (<i>self</i>, QDomImplementation)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDomImplementation class provides information about the features of the DOM implementation.</p>
<p>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.</p>
<p>Normally you will use the function <a href="qdomdocument.html#implementation">QDomDocument.implementation</a>() to get the implementation object.</p>
<p>You can create a new document type with <a href="qdomimplementation.html#createDocumentType">createDocumentType</a>() and a new document with <a href="qdomimplementation.html#createDocument">createDocument</a>().</p>
<p>For further information about the Document Object Model see <a href="http://www.w3.org/TR/REC-DOM-Level-1/">Level 1</a> and <a href="http://www.w3.org/TR/DOM-Level-2-Core/">Level 2 Core</a>. For a more general introduction of the DOM implementation see the <a href="qdomdocument.html">QDomDocument</a> documentation.</p>
<p>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 <a href="qtxmlpatterns.html">QtXmlPatterns</a> module and the <a href="qxmlstreamreader.html">QXmlStreamReader</a> and <a href="qxmlstreamwriter.html">QXmlStreamWriter</a> classes have a higher degree of a conformance.</p>
<p>See also <a href="qdomimplementation.html#hasFeature">hasFeature</a>().</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="InvalidDataPolicy-enum" />QDomImplementation.InvalidDataPolicy</h3><p>This enum specifies what should be done when a factory function in <a href="qdomdocument.html">QDomDocument</a> is called with invalid data.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDomImplementation.AcceptInvalidChars</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The data should be stored in the DOM object anyway. In this case the resulting XML document might not be well-formed. This is the default value and QDom's behavior in Qt < 4.1.</td></tr>
<tr><td valign="top"><tt>QDomImplementation.DropInvalidChars</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The invalid characters should be removed from the data.</td></tr>
<tr><td valign="top"><tt>QDomImplementation.ReturnNullNode</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The factory function should return a null node.</td></tr>
</table></p>
<p>See also <a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a>() and <a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDomImplementation" />QDomImplementation.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qdomimplementation.html">QDomImplementation</a> object.</p>
<h3 class="fn"><a name="QDomImplementation-2" />QDomImplementation.__init__ (<i>self</i>, <a href="qdomimplementation.html">QDomImplementation</a>)</h3><p>Constructs a copy of <i>x</i>.</p>
<a name="//apple_ref/cpp/instm/QDomImplementation/~QDomImplementation" />
<h3 class="fn"><a name="createDocument" /><a href="qdomdocument.html">QDomDocument</a> QDomImplementation.createDocument (<i>self</i>, QString, QString, <a href="qdomdocumenttype.html">QDomDocumentType</a>)</h3><p>Creates a DOM document with the document type <i>doctype</i>. This function also adds a root element node with the qualified name <i>qName</i> and the namespace URI <i>nsURI</i>.</p>
<a name="//apple_ref/cpp/instm/QDomImplementation/createDocumentType" />
<h3 class="fn"><a name="createDocumentType" /><a href="qdomdocumenttype.html">QDomDocumentType</a> QDomImplementation.createDocumentType (<i>self</i>, QString, QString, QString)</h3><p>Creates a document type node for the name <i>qName</i>.</p>
<p><i>publicId</i> specifies the public identifier of the external subset. If you specify an empty string (QString()) as the <i>publicId</i>, this means that the document type has no public identifier.</p>
<p><i>systemId</i> specifies the system identifier of the external subset. If you specify an empty string as the <i>systemId</i>, this means that the document type has no system identifier.</p>
<p>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.</p>
<p>DOM level 2 does not support any other document type declaration features.</p>
<p>The only way you can use a document type that was created this way, is in combination with the <a href="qdomimplementation.html#createDocument">createDocument</a>() function to create a <a href="qdomdocument.html">QDomDocument</a> with this document type.</p>
<p>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 <a href="qdomdocument.html#createElement">QDomDocument.createElement</a>(), is called. The document also becomes non-null when setContent() is called.</p>
<p>See also <a href="qdomimplementation.html#createDocument">createDocument</a>().</p>
<a name="//apple_ref/cpp/instm/QDomImplementation/hasFeature" />
<h3 class="fn"><a name="hasFeature" />bool QDomImplementation.hasFeature (<i>self</i>, QString, QString)</h3><p>The function returns true if QDom implements the requested <i>version</i> of a <i>feature</i>; otherwise returns false.</p>
<p>The currently supported features and their versions:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th>Feature</th><th>Version</th></tr></thead>
<tr class="odd" valign="top"><td>XML</td><td>1.0</td></tr>
</table></p>
<a name="//apple_ref/cpp/clm/QDomImplementation/invalidDataPolicy" />
<h3 class="fn"><a name="invalidDataPolicy" /><a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a> QDomImplementation.invalidDataPolicy ()</h3><p>Returns the invalid data policy, which specifies what should be done when a factory function in <a href="qdomdocument.html">QDomDocument</a> is passed invalid data.</p>
<p><b>Warning:</b> This function is not <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a>() and <a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a>.</p>
<a name="//apple_ref/cpp/instm/QDomImplementation/isNull" />
<h3 class="fn"><a name="isNull" />bool QDomImplementation.isNull (<i>self</i>)</h3><p>Returns false if the object was created by <a href="qdomdocument.html#implementation">QDomDocument.implementation</a>(); otherwise returns true.</p>
<a name="//apple_ref/cpp/clm/QDomImplementation/setInvalidDataPolicy" />
<h3 class="fn"><a name="setInvalidDataPolicy" />QDomImplementation.setInvalidDataPolicy (<a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a>)</h3><p>Sets the invalid data policy, which specifies what should be done when a factory function in <a href="qdomdocument.html">QDomDocument</a> is passed invalid data.</p>
<p>The <i>policy</i> is set for all instances of <a href="qdomdocument.html">QDomDocument</a> which already exist and which will be created in the future.</p>
<pre> QDomDocument doc;
QDomImplementation impl;
<span class="comment"> // This will create the element, but the resulting XML document will</span>
<span class="comment"> // be invalid, because '~' is not a valid character in a tag name.</span>
impl.setInvalidDataPolicy(QDomImplementation.AcceptInvalidData);
QDomElement elt1 = doc.createElement("foo~bar");
<span class="comment"> // This will create an element with the tag name "foobar".</span>
impl.setInvalidDataPolicy(QDomImplementation.DropInvalidData);
QDomElement elt2 = doc.createElement("foo~bar");
<span class="comment"> // This will create a null element.</span>
impl.setInvalidDataPolicy(QDomImplementation.ReturnNullNode);
QDomElement elt3 = doc.createElement("foo~bar");</pre>
<p><b>Warning:</b> This function is not <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a>() and <a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a>.</p>
<a name="//apple_ref/cpp/instm/QDomImplementation/operator!=" />
<h3 class="fn"><a name="__eq__" />bool QDomImplementation.__eq__ (<i>self</i>, <a href="qdomimplementation.html">QDomImplementation</a>)</h3><h3 class="fn"><a name="__ne__" />bool QDomImplementation.__ne__ (<i>self</i>, <a href="qdomimplementation.html">QDomImplementation</a>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.2</td></tr></table></div></address></body></html>
|