<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QDomDocument Class Reference ## [[QtXml](index.htm) module] 該QDomDocument類表示XML文檔。[More...](#details) 繼承[QDomNode](qdomnode.html)。 ### Methods * `__init__ (self)` * `__init__ (self, QString?name)` * `__init__ (self, QDomDocumentType?doctype)` * `__init__ (self, QDomDocument?x)` * `QDomAttr createAttribute (self, QString?name)` * `QDomAttr createAttributeNS (self, QString?nsURI, QString?qName)` * `QDomCDATASection createCDATASection (self, QString?data)` * `QDomComment createComment (self, QString?data)` * `QDomDocumentFragment createDocumentFragment (self)` * `QDomElement createElement (self, QString?tagName)` * `QDomElement createElementNS (self, QString?nsURI, QString?qName)` * `QDomEntityReference createEntityReference (self, QString?name)` * `QDomProcessingInstruction createProcessingInstruction (self, QString?target, QString?data)` * `QDomText createTextNode (self, QString?data)` * `QDomDocumentType doctype (self)` * `QDomElement documentElement (self)` * `QDomElement elementById (self, QString?elementId)` * `QDomNodeList elementsByTagName (self, QString?tagname)` * `QDomNodeList elementsByTagNameNS (self, QString?nsURI, QString?localName)` * `QDomImplementation implementation (self)` * `QDomNode importNode (self, QDomNode?importedNode, bool?deep)` * `QDomNode.NodeType nodeType (self)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QByteArray?data, bool?namespaceProcessing)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QString?text, bool?namespaceProcessing)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QIODevice?dev, bool?namespaceProcessing)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QXmlInputSource?source, bool?namespaceProcessing)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QByteArray?buffer)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QString?text)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QIODevice?dev)` * `(bool, QString?errorMsg, int?errorLine, int?errorColumn) setContent (self, QXmlInputSource?source, QXmlReader?reader)` * `QByteArray toByteArray (self, int?indent?=?1)` * `QString toString (self, int?indent?=?1)` * * * ## Detailed Description 該QDomDocument類表示XML文檔。 該QDomDocument類代表整個XML文檔。從概念上講,它是文檔樹的根,并提供主要訪問到文檔的數據。 由于元素,文本節點,注釋,處理指令等,不能在文檔的上下文之外存在,文件類還包含創建這些對象所需的工廠函數。創建節點對象有一個[ownerDocument](qdomnode.html#ownerDocument)( )函數并將它們與在文檔的背景下,他們創建的。將使用DOM類最經常是[QDomNode](qdomnode.html), QDomDocument ,[QDomElement](qdomelement.html)和[QDomText](qdomtext.html)。 解析后的XML是由可以使用各種QDom類訪問對象樹內部表示。只有所有QDom類_reference_在內部樹的對象。一旦引用他們和QDomDocument本身最后QDom對象被刪除在DOM樹中的內部對象會被刪除。 完成創作元素,文本節點等的使用在這個類中提供的各種工廠的功能。使用QDom類的默認構造函數只會造成無法操縱或插入到文檔中的空對象。 該QDomDocument類有多種功能,用于創建文件的數據,例如,[createElement](qdomdocument.html#createElement)( )[createTextNode](qdomdocument.html#createTextNode)( )[createComment](qdomdocument.html#createComment)( )[createCDATASection](qdomdocument.html#createCDATASection)( )[createProcessingInstruction](qdomdocument.html#createProcessingInstruction)( )[createAttribute](qdomdocument.html#createAttribute)()和[createEntityReference](qdomdocument.html#createEntityReference)( ) 。其中的一些功能有支持命名空間的版本,即[createElementNS](qdomdocument.html#createElementNS)()和[createAttributeNS](qdomdocument.html#createAttributeNS)( ) 。該[createDocumentFragment](qdomdocument.html#createDocumentFragment)()函數是用于保存文件的部分,這是用于操作復雜的文件是有用的。 該文件的整個內容設置與[setContent](qdomdocument.html#setContent)( ) 。這個函數解析它通過為XML文檔的字符串,并創建DOM樹,代表該文件。使用根元素可用[documentElement](qdomdocument.html#documentElement)( ) 。可使用獲得的文件的文字表述[toString](qdomdocument.html#toString)( ) 。 **Note:**DOM樹可能最終保留了大量的內存,如果XML文檔是很大的。對于大的XML文檔,[QXmlStreamReader](qxmlstreamreader.html)或[QXmlQuery](qxmlquery.html)類可能是更好的解決方案。 它可以使用插入來自另一個文檔中的節點插入到文檔中[importNode](qdomdocument.html#importNode)( ) 。 可以得到所有具有帶有特定標記的元素的列表[elementsByTagName](qdomdocument.html#elementsByTagName)()或與[elementsByTagNameNS](qdomdocument.html#elementsByTagNameNS)( ) 。 該QDom類通常使用如下: ``` QDomDocument doc("mydocument"); [QFile](qfile.html) file("mydocument.xml"); if (!file.open([QIODevice](qiodevice.html).ReadOnly)) return; if (!doc.setContent(&file)) { file.close(); return; } file.close(); // print out the element names of all elements that are direct children // of the outermost element. [QDomElement](qdomelement.html) docElem = doc.documentElement(); [QDomNode](qdomnode.html) n = docElem.firstChild(); while(!n.isNull()) { [QDomElement](qdomelement.html) e = n.toElement(); // try to convert the node to an element. if(!e.isNull()) { cout << qPrintable(e.tagName()) << endl; // the node really is an element. } n = n.nextSibling(); } // Here we append a new element to the end of the document [QDomElement](qdomelement.html) elem = doc.createElement("img"); elem.setAttribute("src", "myimage.png"); docElem.appendChild(elem); ``` 一旦`doc`和`elem`走出去的范圍,表示XML文檔的整個內部樹被刪除。 若要使用這樣的DOM代碼使用的文件: ``` QDomDocument doc("MyML"); [QDomElement](qdomelement.html) root = doc.createElement("MyML"); doc.appendChild(root); [QDomElement](qdomelement.html) tag = doc.createElement("Greeting"); root.appendChild(tag); [QDomText](qdomtext.html) t = doc.createTextNode("Hello World"); tag.appendChild(t); [QString](qstring.html) xml = doc.toString(); ``` 關于文檔對象模型更多信息,請參閱文檔對象模型(DOM )[Level 1](http://www.w3.org/TR/REC-DOM-Level-1/)和[Level 2 Core](http://www.w3.org/TR/DOM-Level-2-Core/)規格。 * * * ## Method Documentation ``` QDomDocument.__init__ (self) ``` 構造一個空文檔。 ``` QDomDocument.__init__ (self, QString?name) ``` 創建文檔并設置文檔類型的名稱_name_。 ``` QDomDocument.__init__ (self, QDomDocumentType?doctype) ``` 創建具有文檔類型的文檔_doctype_。 **See also** [QDomImplementation.createDocumentType](qdomimplementation.html#createDocumentType)( ) 。 ``` QDomDocument.__init__ (self, QDomDocument?x) ``` 構造的副本_x_。 副本的數據是共享的(淺拷貝) :修改一個節點也將改變其他。如果你想使一個深拷貝,使用[cloneNode](qdomnode.html#cloneNode)( ) 。 ``` QDomAttr QDomDocument.createAttribute (self, QString?name) ``` [](qdomattr.html) [創建一個名為新的屬性_name_該可插入一個元素,例如運用](qdomattr.html)[QDomElement.setAttributeNode](qdomelement.html#setAttributeNode)( ) 。 If _name_是不是一個有效的XML名稱,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [createAttributeNS](qdomdocument.html#createAttributeNS)( ) 。 ``` QDomAttr QDomDocument.createAttributeNS (self, QString?nsURI, QString?qName) ``` [](qdomattr.html) [創建一個具有可插入一個元素的命名空間支持一個新的屬性。該屬性的名稱是_qName_和命名空間URI為_nsURI_。該功能還將](qdomattr.html)[QDomNode.prefix](qdomnode.html#prefix)()和[QDomNode.localName](qdomnode.html#localName)( )為適當的值(取決于_qName_) 。 If _qName_是不是一個有效的XML名稱,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [createAttribute](qdomdocument.html#createAttribute)( ) 。 ``` QDomCDATASection QDomDocument.createCDATASection (self, QString?data) ``` [](qdomcdatasection.html) [創建字符串一個新的CDATA節_value_能夠被插入到文檔中,例如運用](qdomcdatasection.html)[QDomNode.appendChild](qdomnode.html#appendChild)( ) 。 If _value_包含不能被存儲在一個CDATA節的字符,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [QDomNode.appendChild](qdomnode.html#appendChild)( )[QDomNode.insertBefore](qdomnode.html#insertBefore)()和[QDomNode.insertAfter](qdomnode.html#insertAfter)( ) 。 ``` QDomComment QDomDocument.createComment (self, QString?data) ``` [](qdomcomment.html) [創建字符串新評論_value_能夠被插入到文檔中,例如運用](qdomcomment.html)[QDomNode.appendChild](qdomnode.html#appendChild)( ) 。 If _value_包含不能被存儲在XML注釋字符,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [QDomNode.appendChild](qdomnode.html#appendChild)( )[QDomNode.insertBefore](qdomnode.html#insertBefore)()和[QDomNode.insertAfter](qdomnode.html#insertAfter)( ) 。 ``` QDomDocumentFragment QDomDocument.createDocumentFragment (self) ``` [ 創建一個新的文檔片段,可用于保存文件的部分,例如做文檔樹的復雜的操作時。 ](qdomdocumentfragment.html) ``` QDomElement QDomDocument.createElement (self, QString?tagName) ``` [](qdomelement.html) [創建一個名為新元素_tagName_能夠被插入到DOM樹中,例如運用](qdomelement.html)[QDomNode.appendChild](qdomnode.html#appendChild)( ) 。 If _tagName_是不是一個有效的XML名稱,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 [QDomNode.insertAfter](qdomnode.html#insertAfter)( ) **See also** [createElementNS](qdomdocument.html#createElementNS)( )[QDomNode.appendChild](qdomnode.html#appendChild)()和[QDomNode.insertBefore](qdomnode.html#insertBefore)( ) 。 ``` QDomElement QDomDocument.createElementNS (self, QString?nsURI, QString?qName) ``` [](qdomelement.html) [創建一個具有可插入到DOM樹中的命名空間支持的新元素。元素的名稱是_qName_和命名空間URI為_nsURI_。該功能還將](qdomelement.html)[QDomNode.prefix](qdomnode.html#prefix)()和[QDomNode.localName](qdomnode.html#localName)( )為適當的值(取決于_qName_) 。 If _qName_是一個空字符串,返回一個空元素不管無效的數據策略是否被設置。 **See also** [createElement](qdomdocument.html#createElement)( ) 。 ``` QDomEntityReference QDomDocument.createEntityReference (self, QString?name) ``` [](qdomentityreference.html) [創建一個名為一個新的實體引用_name_能夠被插入到文檔中,例如運用](qdomentityreference.html)[QDomNode.appendChild](qdomnode.html#appendChild)( ) 。 If _name_是不是一個有效的XML名稱,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [QDomNode.appendChild](qdomnode.html#appendChild)( )[QDomNode.insertBefore](qdomnode.html#insertBefore)()和[QDomNode.insertAfter](qdomnode.html#insertAfter)( ) 。 ``` QDomProcessingInstruction QDomDocument.createProcessingInstruction (self, QString?target, QString?data) ``` [](qdomprocessinginstruction.html) [創建一個新的處理指令可以被插入到文檔中,例如運用](qdomprocessinginstruction.html)[QDomNode.appendChild](qdomnode.html#appendChild)( ) 。此功能設置為處理指令的目標_target_以及將數據_data_。 If _target_是不是一個有效的XML名稱,或者數據,如果包含不能出現在一個處理指令字符,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [QDomNode.appendChild](qdomnode.html#appendChild)( )[QDomNode.insertBefore](qdomnode.html#insertBefore)()和[QDomNode.insertAfter](qdomnode.html#insertAfter)( ) 。 ``` QDomText QDomDocument.createTextNode (self, QString?data) ``` [](qdomtext.html) [創建字符串的文本節點_value_能夠被插入到文檔樹,例如運用](qdomtext.html)[QDomNode.appendChild](qdomnode.html#appendChild)( ) 。 If _value_包含不能被保存為一個XML文檔(即使在字符引用的形式)的字符數據的字符,這個函數的行為受約束[QDomImplementation.InvalidDataPolicy](qdomimplementation.html#InvalidDataPolicy-enum)。 **See also** [QDomNode.appendChild](qdomnode.html#appendChild)( )[QDomNode.insertBefore](qdomnode.html#insertBefore)()和[QDomNode.insertAfter](qdomnode.html#insertAfter)( ) 。 ``` QDomDocumentType QDomDocument.doctype (self) ``` [ 返回此文件的文件類型。 ](qdomdocumenttype.html) ``` QDomElement QDomDocument.documentElement (self) ``` [ 返回文檔的根元素。 ](qdomelement.html) ``` QDomElement QDomDocument.elementById (self, QString?elementId) ``` [](qdomelement.html) [返回其ID等于元件_elementId_。如果被發現與ID號的元素,這個函數返回一個](qdomelement.html)[null element](qdomnode.html#isNull)。 由于QDomClasses不知道哪個屬性是元素的ID ,這個函數返回一個永遠[null element](qdomnode.html#isNull)。這可能會改變在未來的版本。 ``` QDomNodeList QDomDocument.elementsByTagName (self, QString?tagname) ``` [](qdomnodelist.html) [返回](qdomnodelist.html)[QDomNodeList](qdomnodelist.html),包含所有文件中的名稱元素_tagname_。節點列表的順序是它們在元素樹的先序遍歷出現的順序。 **See also** [elementsByTagNameNS](qdomdocument.html#elementsByTagNameNS)()和[QDomElement.elementsByTagName](qdomelement.html#elementsByTagName)( ) 。 ``` QDomNodeList QDomDocument.elementsByTagNameNS (self, QString?nsURI, QString?localName) ``` [](qdomnodelist.html) [返回](qdomnodelist.html)[QDomNodeList](qdomnodelist.html)包含所有的文件與本地名稱的元素_localName_和命名空間的URI_nsURI_。節點列表的順序是它們在元素樹的先序遍歷出現的順序。 **See also** [elementsByTagName](qdomdocument.html#elementsByTagName)()和[QDomElement.elementsByTagNameNS](qdomelement.html#elementsByTagNameNS)( ) 。 ``` QDomImplementation QDomDocument.implementation (self) ``` [](qdomimplementation.html) [返回](qdomimplementation.html)[QDomImplementation](qdomimplementation.html)對象。 ``` QDomNode QDomDocument.importNode (self, QDomNode?importedNode, bool?deep) ``` [ 進口的節點_importedNode_從另一個文件于本文件。_importedNode_仍然在原始文檔中,該函數創建一個可以在此文檔中使用的副本。 ](qdomnode.html) [該函數返回輸入節點屬于這個文件。返回的節點沒有父。這是不可能的導入](qdomnode.html)[QDomDocument](qdomdocument.html)和[QDomDocumentType](qdomdocumenttype.html)節點。在這種情況下,該函數返回一個[null node](qdomnode.html#isNull)。 If _deep_誠然,這個功能的進口不僅節點_importedNode_但它的整個子樹,如果它是假的,只有_importedNode_是進口的。這個論點_deep_有對無影響[QDomAttr](qdomattr.html)和[QDomEntityReference](qdomentityreference.html)節點,因為的后代[QDomAttr](qdomattr.html)節點總是進口和那些[QDomEntityReference](qdomentityreference.html)節點永遠不會進口。 此函數的行為是稍有不同,這取決于節點類型: | Node Type | Behavior | | --- | --- | | [QDomAttr](qdomattr.html) | The owner element is set to 0 and the specified flag is set to true in the generated attribute. The whole subtree of _importedNode_ is always imported for attribute nodes: _deep_ has no effect. | | [QDomDocument](qdomdocument.html) | Document nodes cannot be imported. | | [QDomDocumentFragment](qdomdocumentfragment.html) | If _deep_ is true, this function imports the whole document fragment; otherwise it only generates an empty document fragment. | | [QDomDocumentType](qdomdocumenttype.html) | Document type nodes cannot be imported. | | [QDomElement](qdomelement.html) | Attributes for which [QDomAttr.specified](qdomattr.html#specified)() is true are also imported, other attributes are not imported. If _deep_ is true, this function also imports the subtree of _importedNode_; otherwise it imports only the element node (and some attributes, see above). | | [QDomEntity](qdomentity.html) | Entity nodes can be imported, but at the moment there is no way to use them since the document type is read-only in DOM level 2. | | [QDomEntityReference](qdomentityreference.html) | Descendants of entity reference nodes are never imported: _deep_ has no effect. | | [QDomNotation](qdomnotation.html) | Notation nodes can be imported, but at the moment there is no way to use them since the document type is read-only in DOM level 2. | | [QDomProcessingInstruction](qdomprocessinginstruction.html) | The target and value of the processing instruction is copied to the new node. | | [QDomText](qdomtext.html) | The text is copied to the new node. | | [QDomCDATASection](qdomcdatasection.html) | The text is copied to the new node. | | [QDomComment](qdomcomment.html) | The text is copied to the new node. | [QDomNode.insertAfter](qdomnode.html#insertAfter)( )[QDomNode.replaceChild](qdomnode.html#replaceChild)( )[QDomNode.removeChild](qdomnode.html#removeChild)( )[QDomNode.appendChild](qdomnode.html#appendChild)( ) **See also** [QDomElement.setAttribute](qdomelement.html#setAttribute)()和[QDomNode.insertBefore](qdomnode.html#insertBefore)( ) 。 ``` QDomNode.NodeType QDomDocument.nodeType (self) ``` [ Returns `DocumentNode`。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QByteArray?data, bool?namespaceProcessing) ``` 該函數從字節數組解析XML文檔_data_并且將其設置為文件的內容。它會嘗試檢測文件的編碼所要求的XML規范。 If _namespaceProcessing_誠然,解析器識別命名空間的XML文件中,并設置前綴名,本地名稱和命名空間URI為適當的值。如果_namespaceProcessing_是假的,解析器確實沒有命名空間的處理時,它讀取XML文件。 ](qdomnode.html#NodeType-enum) [如果出現語法錯誤,這個函數返回False ,并且錯誤信息被放置在`*`_errorMsg_中的行號`*`_errorLine_并且在列號`*`_errorColumn_(除非相關指針設置為0 ) ,否則該函數返回True。各種錯誤信息的描述](qdomnode.html#NodeType-enum)[QXmlParseException](qxmlparseexception.html)類文檔。需要注意的是,如果你想顯示這些錯誤信息到您的應用程序的用戶,他們將,除非他們明確地翻譯英文顯示。 If _namespaceProcessing_為真時,函數[QDomNode.prefix](qdomnode.html#prefix)( )返回一個字符串的所有元素和屬性。它返回一個空字符串,如果該元素或屬性沒有前綴。 空白只包括文本節點被剝離,而不會出現在[QDomDocument](qdomdocument.html)。如果這種行為是不是需要,可以使用使用setContent ()重載,允許[QXmlReader](qxmlreader.html)要被提供。 If _namespaceProcessing_是假的,功能[QDomNode.prefix](qdomnode.html#prefix)( )[QDomNode.localName](qdomnode.html#localName)()和[QDomNode.namespaceURI](qdomnode.html#namespaceURIx)( )返回一個空字符串。 實體引用的處理方式如下: * References to internal general entities and character entities occurring in the content are included. The result is a [QDomText](qdomtext.html) node with the references replaced by their corresponding entity values. * References to parameter entities occurring in the internal subset are included. The result is a [QDomDocumentType](qdomdocumenttype.html) node which contains entity and notation declarations with the references replaced by their corresponding entity values. * Any general parsed entity reference which is not defined in the internal subset and which occurs in the content is represented as a [QDomEntityReference](qdomentityreference.html) node. * Any parsed entity reference which is not defined in the internal subset and which occurs outside of the content is replaced with an empty string. * Any unparsed entity reference is replaced with an empty string. [QDomNode.prefix](qdomnode.html#prefix)( )[QString.isNull](qstring.html#isNull)( )[QString.isEmpty](qstring.html#isEmpty)( ) **Warning:**此功能不[reentrant](index.htm#reentrant)。 **See also** [QDomNode.namespaceURI](qdomnode.html#namespaceURIx)()和[QDomNode.localName](qdomnode.html#localName)( ) 。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QString?text, bool?namespaceProcessing) ``` 這是一個重載函數。 該函數從字符串讀取XML文檔_text_,返回True,如果內容被成功解析,否則返回False 。自_text_已經是一個Unicode字符串,沒有編碼檢測完成。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QIODevice?dev, bool?namespaceProcessing) ``` 這是一個重載函數。 該函數讀取從IO設備的XML文檔_dev_,返回True,如果內容被成功解析,否則返回False 。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QXmlInputSource?source, bool?namespaceProcessing) ``` 這是一個重載函數。 該函數從XML文檔[QXmlInputSource](qxmlinputsource.html) _source_,返回True,如果內容被成功解析,否則返回False 。 此功能被引入Qt的4.5 。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QByteArray?buffer) ``` 這是一個重載函數。 該函數從字符串讀取XML文檔_text_,返回True,如果內容被成功解析,否則返回False 。自_text_已經是一個Unicode字符串,不進行任何編碼檢測。 不執行任何命名空間的處理要么。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QString?text) ``` 這是一個重載函數。 該函數讀取從字節數組的XML文檔_buffer_,返回True,如果內容被成功解析,否則返回False 。 不執行任何命名空間的處理。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QIODevice?dev) ``` 這是一個重載函數。 該函數讀取從IO設備的XML文檔_dev_,返回True,如果內容被成功解析,否則返回False 。 不執行任何命名空間的處理。 ``` (bool, QString?errorMsg, int?errorLine, int?errorColumn) QDomDocument.setContent (self, QXmlInputSource?source, QXmlReader?reader) ``` 這是一個重載函數。 該函數從XML文檔[QXmlInputSource](qxmlinputsource.html) _source_并與解析它[QXmlReader](qxmlreader.html) _reader_,返回True,如果內容被成功解析,否則返回False 。 此功能不會改變的特點_reader_。如果你想使用某些功能解析您可以使用此功能來設立適當的讀者。 **See also** [QXmlSimpleReader](qxmlsimplereader.html)。 ``` QByteArray QDomDocument.toByteArray (self, int?indent?=?1) ``` [](qbytearray.html) [解析后的文檔轉換回其文字表述,并返回一個](qbytearray.html)[QByteArray](qbytearray.html)含有編碼為UTF- 8的數據。 此函數使用_indent_由于空間的子元素縮進量。 **See also** [toString](qdomdocument.html#toString)( ) 。 ``` QString QDomDocument.toString (self, int?indent?=?1) ``` 解析后的文檔轉換回其文字表述。 此函數使用_indent_由于空間的子元素縮進量。 If _indent_為-1 ,任何空白都被添加。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看