⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qdomdocument.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p> <p>See also <a href="#elementsByTagName">elementsByTagName</a>() and <a href="qdomelement.html#elementsByTagNameNS">QDomElement::elementsByTagNameNS</a>().<h3 class=fn><a href="qdomimplementation.html">QDomImplementation</a> <a name="implementation"></a>QDomDocument::implementation () const</h3>Returns a <a href="qdomimplementation.html">QDomImplementation</a> object.<h3 class=fn><a href="qdomnode.html">QDomNode</a> <a name="importNode"></a>QDomDocument::importNode ( const&nbsp;<a href="qdomnode.html">QDomNode</a>&nbsp;&amp;&nbsp;importedNode, bool&nbsp;deep )</h3>Imports the node <em>importedNode</em> from another document to this document. <em>importedNode</em> remains in the original document; this function creates a copyof it that can be used within this document.<p> This function returns the imported node that belongs to this document. Thereturned node has no parent. It is not possible to import QDomDocument and<a href="qdomdocumenttype.html">QDomDocumentType</a> nodes. In those cases this function returns a null node.<p> If <em>deep</em> is TRUE, this function imports not only the node <em>importedNode</em>but the whole subtree; if it is FALSE, only the <em>importedNode</em> is imported.The argument <em>deep</em> has no effect on <a href="qdomattr.html">QDomAttr</a> and <a href="qdomentityreference.html">QDomEntityReference</a>nodes, since the descendants of QDomAttr nodes are always imported and thoseof QDomEntityReference nodes are never imported.<p> The behavior of this function is slightly different depending on the nodetypes:<ul><li> QDomAttr - The owner element is set to 0 and the specified flag is setto TRUE on the generated attribute.  The whole subtree of <em>importedNode</em> is always imported for attribute nodes - <em>deep</em> has noeffect.<li> QDomDocument - Document nodes cannot be imported.<li> <a href="qdomdocumentfragment.html">QDomDocumentFragment</a> - If <em>deep</em> is TRUE, this function imports thewhole document fragment, otherwise it only generates an empty documentfragment.<li> <a href="qdomdocumenttype.html">QDomDocumentType</a> - Document type nodes cannot be imported.<li> <a href="qdomelement.html">QDomElement</a> - Attributes for which <a href="qdomattr.html#specified">QDomAttr::specified</a>() is TRUE arealso imported, other attributes are not imported.  If <em>deep</em> is TRUE,this function also imports the subtree of <em>importedNode</em>, otherwise itimports only the element node (and some attributes, see above).<li> <a href="qdomentity.html">QDomEntity</a> - Entity nodes can be imported, but at the moment there is noway to use them since the document type is readonly in DOM level 2.<li> <a href="qdomentityreference.html">QDomEntityReference</a> - Descendants of entity reference nodes are neverimported - <em>deep</em> has no effect.<li> <a href="qdomnotation.html">QDomNotation</a> - Notation nodes can be imported, but at the moment thereis no way to use them since the document type is readonly in DOM level 2.<li> <a href="qdomprocessinginstruction.html">QDomProcessingInstruction</a> - The target and value of the processinginstruction is copied to the new node.<li> <a href="qdomtext.html">QDomText</a>, <a href="qdomcdatasection.html">QDomCDATASection</a> and <a href="qdomcomment.html">QDomComment</a> - The text is copied to thenew node.</ul><p> <p>See also <a href="qdomelement.html#setAttribute">QDomElement::setAttribute</a>(), <a href="qdomnode.html#insertBefore">QDomNode::insertBefore</a>(), <a href="qdomnode.html#insertAfter">QDomNode::insertAfter</a>(), <a href="qdomnode.html#replaceChild">QDomNode::replaceChild</a>(), <a href="qdomnode.html#removeChild">QDomNode::removeChild</a>() and <a href="qdomnode.html#appendChild">QDomNode::appendChild</a>().<h3 class=fn>bool <a name="isDocument"></a>QDomDocument::isDocument () const<tt> [virtual]</tt></h3>Returns TRUE.<p>Reimplemented from <a href="qdomnode.html#isDocument">QDomNode</a>.<h3 class=fn><a href="qdomnode.html#NodeType-enum">QDomNode::NodeType</a> <a name="nodeType"></a>QDomDocument::nodeType () const<tt> [virtual]</tt></h3>Returns <a href="qdomnode.html#NodeType-enum">DocumentNode</a>.<p>Reimplemented from <a href="qdomnode.html#nodeType">QDomNode</a>.<h3 class=fn><a href="qdomdocument.html">QDomDocument</a>&nbsp;&amp; <a name="operator-eq"></a>QDomDocument::operator= ( const&nbsp;<a href="qdomdocument.html">QDomDocument</a>&nbsp;&amp;&nbsp;x )</h3>Assigns <em>x</em> to this DOM document.<p> The data of the copy is shared (shallow copy): modifying one node will alsochange the other. If you want to make a <a href="shclass.html#deep-copy">deep copy</a>, use <a href="qdomnode.html#cloneNode">cloneNode</a>().<h3 class=fn>bool <a name="setContent"></a>QDomDocument::setContent ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;buffer, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>This function parses the XML document from the byte array <em>buffer</em> and setsit as the content of the document. It tries to detect the encoding of thedocument as required by the XML specification.<p> If <em>namespaceProcessing</em> is TRUE, the parser recognizes namespaces in theXML file and sets the prefix name, local name and namespace URI toappropriate values. If <em>namespaceProcessing</em> is FALSE, the parser does nonamespace processing when it reads the XML file.<p> If a parse error occurs, the function returns FALSE; otherwise TRUE. If aparse error occurs the error message is placed in <em>*</em><em>errorMsg</em>, the linenumber in <em>*</em><em>errorLine</em> and the column number in <em>*</em><em>errorColumn</em>. Theseerror variables will only be populated if they are non-null.<p> If <em>namespaceProcessing</em> is TRUE, the function <a href="qdomnode.html#prefix">QDomNode::prefix</a>() returnsa string for all elements and attributes. It returns an empty string if theelement or attribute has no prefix.<p> If <em>namespaceProcessing</em> is FALSE, the functions QDomNode::prefix(),<a href="qdomnode.html#localName">QDomNode::localName</a>() and <a href="qdomnode.html#namespaceURI">QDomNode::namespaceURI</a>() return a null string.<p> <p>See also <a href="qdomnode.html#namespaceURI">QDomNode::namespaceURI</a>(), <a href="qdomnode.html#localName">QDomNode::localName</a>(), <a href="qdomnode.html#prefix">QDomNode::prefix</a>(), <a href="qstring.html#isNull">QString::isNull</a>() and <a href="qstring.html#isEmpty">QString::isEmpty</a>().<h3 class=fn>bool <a name="setContent-2"></a>QDomDocument::setContent ( const&nbsp;<a href="qcstring.html">QCString</a>&nbsp;&amp;&nbsp;buffer, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the C string <em>buffer</em>.<p> Use this function with extreme care, since it does not try to detect theencoding, but rather assumes that the C string is in Utf8 encoding.<h3 class=fn>bool <a name="setContent-3"></a>QDomDocument::setContent ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the string <em>text</em>. Since <em>text</em>is already a unicode string, no encoding detection is done.<h3 class=fn>bool <a name="setContent-4"></a>QDomDocument::setContent ( <a href="qiodevice.html">QIODevice</a>&nbsp;*&nbsp;dev, bool&nbsp;namespaceProcessing, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the IO device <em>dev</em>.<h3 class=fn>bool <a name="setContent-5"></a>QDomDocument::setContent ( const&nbsp;<a href="qcstring.html">QCString</a>&nbsp;&amp;&nbsp;buffer, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the C string <em>buffer</em>.<p> Use this function with extreme care, since it does not try to detect theencoding, but rather assumes that the C string is in Utf8 encoding.<p> No namespace processing is done.<h3 class=fn>bool <a name="setContent-6"></a>QDomDocument::setContent ( const&nbsp;<a href="qbytearray.html">QByteArray</a>&nbsp;&amp;&nbsp;buffer, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the byte array <em>buffer</em>.<p> No namespace processing is done.<h3 class=fn>bool <a name="setContent-7"></a>QDomDocument::setContent ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the string <em>text</em>. Since <em>text</em>is already a unicode string, no encoding detection is done.<p> No namespace processing is done.<h3 class=fn>bool <a name="setContent-8"></a>QDomDocument::setContent ( <a href="qiodevice.html">QIODevice</a>&nbsp;*&nbsp;dev, <a href="qstring.html">QString</a>&nbsp;*&nbsp;errorMsg = 0, int&nbsp;*&nbsp;errorLine = 0, int&nbsp;*&nbsp;errorColumn = 0 )</h3>  This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> This function reads the XML document from the IO device <em>dev</em>.<p> No namespace processing is done.<h3 class=fn><a href="qcstring.html">QCString</a> <a name="toCString"></a>QDomDocument::toCString () const</h3>Converts the parsed document back to its textual representation and returns a<a href="qcstring.html">QCString</a> for that is encoded in UTF-8.<p> <p>See also <a href="#toString">toString</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="toString"></a>QDomDocument::toString () const</h3>Converts the parsed document back to its textual representation.<p> <p>See also <a href="#toCString">toCString</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -