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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdom.cpp -->
<title>Qt 4.8: QDomImplementation Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtxml.html">QtXml</a></li>
<li>QDomImplementation</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QDomImplementation Class Reference</h1>
<!-- $$$QDomImplementation-brief -->
<p>The QDomImplementation class provides information about the features of the DOM implementation. <a href="#details">More...</a></p>
<!-- @@@QDomImplementation -->
<pre class="cpp"> <span class="preprocessor">#include <QDomImplementation></span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>, except for <a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a>() and <a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a>(), which are nonreentrant.</p>
<ul>
<li><a href="qdomimplementation-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a></b> { AcceptInvalidChars, DropInvalidChars, ReturnNullNode }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#QDomImplementation">QDomImplementation</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#QDomImplementation-2">QDomImplementation</a></b> ( const QDomImplementation & <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#dtor.QDomImplementation">~QDomImplementation</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDomDocument </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#createDocument">createDocument</a></b> ( const QString & <i>nsURI</i>, const QString & <i>qName</i>, const QDomDocumentType & <i>doctype</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDomDocumentType </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#createDocumentType">createDocumentType</a></b> ( const QString & <i>qName</i>, const QString & <i>publicId</i>, const QString & <i>systemId</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#hasFeature">hasFeature</a></b> ( const QString & <i>feature</i>, const QString & <i>version</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#isNull">isNull</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#operator-not-eq">operator!=</a></b> ( const QDomImplementation & <i>x</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDomImplementation & </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#operator-eq">operator=</a></b> ( const QDomImplementation & <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#operator-eq-eq">operator==</a></b> ( const QDomImplementation & <i>x</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> InvalidDataPolicy </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a></b> ( InvalidDataPolicy <i>policy</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QDomImplementation-description -->
<div class="descr">
<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>
</div>
<p><b>See also </b><a href="qdomimplementation.html#hasFeature">hasFeature</a>().</p>
<!-- @@@QDomImplementation -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$InvalidDataPolicy$$$AcceptInvalidChars$$$DropInvalidChars$$$ReturnNullNode -->
<h3 class="fn"><a name="InvalidDataPolicy-enum"></a>enum QDomImplementation::<span class="name">InvalidDataPolicy</span></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>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QDomImplementation::AcceptInvalidChars</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">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 class="topAlign"><tt>QDomImplementation::DropInvalidChars</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The invalid characters should be removed from the data.</td></tr>
<tr><td class="topAlign"><tt>QDomImplementation::ReturnNullNode</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The factory function should return a null node.</td></tr>
</table>
<p><b>See also </b><a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a>() and <a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a>().</p>
<!-- @@@InvalidDataPolicy -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDomImplementation[overload1]$$$QDomImplementation -->
<h3 class="fn"><a name="QDomImplementation"></a>QDomImplementation::<span class="name">QDomImplementation</span> ()</h3>
<p>Constructs a <a href="qdomimplementation.html">QDomImplementation</a> object.</p>
<!-- @@@QDomImplementation -->
<!-- $$$QDomImplementation$$$QDomImplementationconstQDomImplementation& -->
<h3 class="fn"><a name="QDomImplementation-2"></a>QDomImplementation::<span class="name">QDomImplementation</span> ( const <span class="type">QDomImplementation</span> & <i>x</i> )</h3>
<p>Constructs a copy of <i>x</i>.</p>
<!-- @@@QDomImplementation -->
<!-- $$$~QDomImplementation[overload1]$$$~QDomImplementation -->
<h3 class="fn"><a name="dtor.QDomImplementation"></a>QDomImplementation::<span class="name">~QDomImplementation</span> ()</h3>
<p>Destroys the object and frees its resources.</p>
<!-- @@@~QDomImplementation -->
<!-- $$$createDocument[overload1]$$$createDocumentconstQString&constQString&constQDomDocumentType& -->
<h3 class="fn"><a name="createDocument"></a><span class="type"><a href="qdomdocument.html">QDomDocument</a></span> QDomImplementation::<span class="name">createDocument</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>nsURI</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>qName</i>, const <span class="type"><a href="qdomdocumenttype.html">QDomDocumentType</a></span> & <i>doctype</i> )</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>
<!-- @@@createDocument -->
<!-- $$$createDocumentType[overload1]$$$createDocumentTypeconstQString&constQString&constQString& -->
<h3 class="fn"><a name="createDocumentType"></a><span class="type"><a href="qdomdocumenttype.html">QDomDocumentType</a></span> QDomImplementation::<span class="name">createDocumentType</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>qName</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>publicId</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>systemId</i> )</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><b>See also </b><a href="qdomimplementation.html#createDocument">createDocument</a>().</p>
<!-- @@@createDocumentType -->
<!-- $$$hasFeature[overload1]$$$hasFeatureconstQString&constQString& -->
<h3 class="fn"><a name="hasFeature"></a><span class="type">bool</span> QDomImplementation::<span class="name">hasFeature</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>feature</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>version</i> ) const</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>
<table class="generic">
<thead><tr class="qt-style"><th >Feature</th><th >Version</th></tr></thead>
<tr valign="top" class="odd"><td >XML</td><td >1.0</td></tr>
</table>
<!-- @@@hasFeature -->
<!-- $$$invalidDataPolicy[overload1]$$$invalidDataPolicy -->
<h3 class="fn"><a name="invalidDataPolicy"></a><span class="type"><a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a></span> QDomImplementation::<span class="name">invalidDataPolicy</span> ()<tt> [static]</tt></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><b>See also </b><a href="qdomimplementation.html#setInvalidDataPolicy">setInvalidDataPolicy</a>() and <a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a>.</p>
<!-- @@@invalidDataPolicy -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QDomImplementation::<span class="name">isNull</span> ()</h3>
<p>Returns false if the object was created by <a href="qdomdocument.html#implementation">QDomDocument::implementation</a>(); otherwise returns true.</p>
<!-- @@@isNull -->
<!-- $$$setInvalidDataPolicy[overload1]$$$setInvalidDataPolicyInvalidDataPolicy -->
<h3 class="fn"><a name="setInvalidDataPolicy"></a><span class="type">void</span> QDomImplementation::<span class="name">setInvalidDataPolicy</span> ( <span class="type"><a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a></span> <i>policy</i> )<tt> [static]</tt></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 class="cpp"> <span class="type"><a href="qdomdocument.html">QDomDocument</a></span> doc;
<span class="type"><a href="qdomimplementation.html">QDomImplementation</a></span> 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<span class="operator">.</span>setInvalidDataPolicy(<span class="type"><a href="qdomimplementation.html">QDomImplementation</a></span><span class="operator">::</span>AcceptInvalidData);
<span class="type"><a href="qdomelement.html">QDomElement</a></span> elt1 <span class="operator">=</span> doc<span class="operator">.</span>createElement(<span class="string">"foo~bar"</span>);
<span class="comment">// This will create an element with the tag name "foobar".</span>
impl<span class="operator">.</span>setInvalidDataPolicy(<span class="type"><a href="qdomimplementation.html">QDomImplementation</a></span><span class="operator">::</span>DropInvalidData);
<span class="type"><a href="qdomelement.html">QDomElement</a></span> elt2 <span class="operator">=</span> doc<span class="operator">.</span>createElement(<span class="string">"foo~bar"</span>);
<span class="comment">// This will create a null element.</span>
impl<span class="operator">.</span>setInvalidDataPolicy(<span class="type"><a href="qdomimplementation.html">QDomImplementation</a></span><span class="operator">::</span>ReturnNullNode);
<span class="type"><a href="qdomelement.html">QDomElement</a></span> elt3 <span class="operator">=</span> doc<span class="operator">.</span>createElement(<span class="string">"foo~bar"</span>);</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><b>See also </b><a href="qdomimplementation.html#invalidDataPolicy">invalidDataPolicy</a>() and <a href="qdomimplementation.html#InvalidDataPolicy-enum">InvalidDataPolicy</a>.</p>
<!-- @@@setInvalidDataPolicy -->
<!-- $$$operator!=[overload1]$$$operator!=constQDomImplementation& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QDomImplementation::<span class="name">operator!=</span> ( const <span class="type">QDomImplementation</span> & <i>x</i> ) const</h3>
<p>Returns true if <i>x</i> and this DOM implementation object were created from different QDomDocuments; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQDomImplementation& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QDomImplementation</span> & QDomImplementation::<span class="name">operator=</span> ( const <span class="type">QDomImplementation</span> & <i>x</i> )</h3>
<p>Assigns <i>x</i> to this DOM implementation.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQDomImplementation& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QDomImplementation::<span class="name">operator==</span> ( const <span class="type">QDomImplementation</span> & <i>x</i> ) const</h3>
<p>Returns true if <i>x</i> and this DOM implementation object were created from the same <a href="qdomdocument.html">QDomDocument</a>; otherwise returns false.</p>
<!-- @@@operator== -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|