<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # QDomNode Class Reference ## [[QtXml](index.htm) module] 該QDomNode類是在DOM樹中所有節點的基類。[More...](#details) 通過繼承[QDomAttr](qdomattr.html),[QDomCharacterData](qdomcharacterdata.html),[QDomDocument](qdomdocument.html),[QDomDocumentFragment](qdomdocumentfragment.html),[QDomDocumentType](qdomdocumenttype.html),[QDomElement](qdomelement.html),[QDomEntity](qdomentity.html),[QDomEntityReference](qdomentityreference.html),[QDomNotation](qdomnotation.html)和[QDomProcessingInstruction](qdomprocessinginstruction.html)。 ### Types * `enum EncodingPolicy { EncodingFromDocument, EncodingFromTextStream }` * `enum NodeType { ElementNode, AttributeNode, TextNode, CDATASectionNode, ..., CharacterDataNode }` ### Methods * `__init__ (self)` * `__init__ (self, QDomNode)` * `QDomNode appendChild (self, QDomNode?newChild)` * `QDomNamedNodeMap attributes (self)` * `QDomNodeList childNodes (self)` * `clear (self)` * `QDomNode cloneNode (self, bool?deep?=?True)` * `int columnNumber (self)` * `QDomNode firstChild (self)` * `QDomElement firstChildElement (self, QString?tagName?=?QString())` * `bool hasAttributes (self)` * `bool hasChildNodes (self)` * `QDomNode insertAfter (self, QDomNode?newChild, QDomNode?refChild)` * `QDomNode insertBefore (self, QDomNode?newChild, QDomNode?refChild)` * `bool isAttr (self)` * `bool isCDATASection (self)` * `bool isCharacterData (self)` * `bool isComment (self)` * `bool isDocument (self)` * `bool isDocumentFragment (self)` * `bool isDocumentType (self)` * `bool isElement (self)` * `bool isEntity (self)` * `bool isEntityReference (self)` * `bool isNotation (self)` * `bool isNull (self)` * `bool isProcessingInstruction (self)` * `bool isSupported (self, QString?feature, QString?version)` * `bool isText (self)` * `QDomNode lastChild (self)` * `QDomElement lastChildElement (self, QString?tagName?=?QString())` * `int lineNumber (self)` * `QString localName (self)` * `QDomNode namedItem (self, QString?name)` * `QString namespaceURI (self)` * `QDomNode nextSibling (self)` * `QDomElement nextSiblingElement (self, QString?tagName?=?QString())` * `QString nodeName (self)` * `NodeType nodeType (self)` * `QString nodeValue (self)` * `normalize (self)` * `QDomDocument ownerDocument (self)` * `QDomNode parentNode (self)` * `QString prefix (self)` * `QDomNode previousSibling (self)` * `QDomElement previousSiblingElement (self, QString?tagName?=?QString())` * `QDomNode removeChild (self, QDomNode?oldChild)` * `QDomNode replaceChild (self, QDomNode?newChild, QDomNode?oldChild)` * `save (self, QTextStream, int)` * `save (self, QTextStream, int, EncodingPolicy)` * `setNodeValue (self, QString)` * `setPrefix (self, QString?pre)` * `QDomAttr toAttr (self)` * `QDomCDATASection toCDATASection (self)` * `QDomCharacterData toCharacterData (self)` * `QDomComment toComment (self)` * `QDomDocument toDocument (self)` * `QDomDocumentFragment toDocumentFragment (self)` * `QDomDocumentType toDocumentType (self)` * `QDomElement toElement (self)` * `QDomEntity toEntity (self)` * `QDomEntityReference toEntityReference (self)` * `QDomNotation toNotation (self)` * `QDomProcessingInstruction toProcessingInstruction (self)` * `QDomText toText (self)` ### Special Methods * `bool __eq__ (self, QDomNode)` * `bool __ne__ (self, QDomNode)` * * * ## Detailed Description 該QDomNode類是在DOM樹中所有節點的基類。 DOM中的許多函數返回一個QDomNode 。 你可以找出使用節點的類型[isAttr](qdomnode.html#isAttr)( )[isCDATASection](qdomnode.html#isCDATASection)( )[isDocumentFragment](qdomnode.html#isDocumentFragment)( )[isDocument](qdomnode.html#isDocument)( )[isDocumentType](qdomnode.html#isDocumentType)( )[isElement](qdomnode.html#isElement)( )[isEntityReference](qdomnode.html#isEntityReference)( )[isText](qdomnode.html#isText)( )[isEntity](qdomnode.html#isEntity)( )[isNotation](qdomnode.html#isNotation)( )[isProcessingInstruction](qdomnode.html#isProcessingInstruction)( )[isCharacterData](qdomnode.html#isCharacterData)()和[isComment](qdomnode.html#isComment)( ) 。 一個QDomNode可以使用轉換成它的子類[toAttr](qdomnode.html#toAttr)( )[toCDATASection](qdomnode.html#toCDATASection)( )[toDocumentFragment](qdomnode.html#toDocumentFragment)( )[toDocument](qdomnode.html#toDocument)( )[toDocumentType](qdomnode.html#toDocumentType)( )[toElement](qdomnode.html#toElement)( )[toEntityReference](qdomnode.html#toEntityReference)( )[toText](qdomnode.html#toText)( )[toEntity](qdomnode.html#toEntity)( )[toNotation](qdomnode.html#toNotation)( )[toProcessingInstruction](qdomnode.html#toProcessingInstruction)( )[toCharacterData](qdomnode.html#toCharacterData)()或[toComment](qdomnode.html#toComment)( ) 。您可以將節點轉換為一個空節點[clear](qdomnode.html#clear)( ) 。 使用顯式共享QDomNode類的副本共享他們的數據。這意味著修改一個節點會改變所有副本。這是結合特別有用,其職能返回QDomNode ,如[firstChild](qdomnode.html#firstChild)( ) 。你可以使節點的獨立(深)副本[cloneNode](qdomnode.html#cloneNode)( ) 。 一個QDomNode可以為null ,很像一個空指針。創建一個空節點結果的副本在另一個空節點。這是不可能修改一個空節點,但也可以指定其他的,可能是非空節點到它。在這種情況下,空節點的拷貝將保持為空。您可以檢查是否有QDomNode為null調用[isNull](qdomnode.html#isNull)( ) 。一個QDomNode (或任何派生類)的空的構造函數創建一個空節點。 節點插入[insertBefore](qdomnode.html#insertBefore)( )[insertAfter](qdomnode.html#insertAfter)()或[appendChild](qdomnode.html#appendChild)( ) 。你可以用另一個替換一個節點使用[replaceChild](qdomnode.html#replaceChild)( )并刪除與節點[removeChild](qdomnode.html#removeChild)( ) 。 遍歷節點使用[firstChild](qdomnode.html#firstChild)()來獲取一個節點的第一個孩子(如果有的話) ,并[nextSibling](qdomnode.html#nextSibling)( )遍歷。 QDomNode還提供[lastChild](qdomnode.html#lastChild)( )[previousSibling](qdomnode.html#previousSibling)()和[parentNode](qdomnode.html#parentNode)( ) 。為了找到與特定節點名稱使用的第一個子節點[namedItem](qdomnode.html#namedItem)( ) 。 要找出如果一個節點有子使用[hasChildNodes](qdomnode.html#hasChildNodes)( ),并得到所有的節點的子節點列表使用[childNodes](qdomnode.html#childNodes)( ) 。 節點的名稱和值(這取決于它的類型而變化的意思)被返回[nodeName](qdomnode.html#nodeName)()和[nodeValue](qdomnode.html#nodeValue)( )分別。節點的類型是由返回[nodeType](qdomnode.html#nodeType)( ) 。該節點的值可以與設置[setNodeValue](qdomnode.html#setNodeValue)( ) 。 到節點所屬的文檔是由返回[ownerDocument](qdomnode.html#ownerDocument)( ) 。 鄰[QDomText](qdomtext.html)節點可以被合并成一個單一的節點[normalize](qdomnode.html#normalize)( ) 。 [QDomElement](qdomelement.html)節點都可以被檢索到的屬性[attributes](qdomnode.html#attributes)( ) 。 [QDomElement](qdomelement.html)和[QDomAttr](qdomattr.html)節點可以有哪些可以檢索與命名空間[namespaceURI](qdomnode.html#namespaceURIx)( ) 。他們的本地名稱與檢索[localName](qdomnode.html#localName)() ,以及它們與前綴[prefix](qdomnode.html#prefix)( ) 。前綴可以被設置[setPrefix](qdomnode.html#setPrefix)( ) 。 您可以寫節點的XML表示文本流[save](qdomnode.html#save)( ) 。 下面的例子查找XML文檔中的第一個元素,并打印所有屬于它的直接子元素的名稱。 ``` [QDomDocument](qdomdocument.html) d; d.setContent(someXML); QDomNode n = d.firstChild(); while (!n.isNull()) { if (n.isElement()) { [QDomElement](qdomelement.html) e = n.toElement(); cout << "Element name: " << e.tagName() << endl; break; } n = n.nextSibling(); } ``` 關于文檔對象模型有進一步的信息[Level 1](http://www.w3.org/TR/REC-DOM-Level-1/)和[Level 2 Core](http://www.w3.org/TR/DOM-Level-2-Core/)。對于更一般介紹的DOM實現的見[QDomDocument](qdomdocument.html)文檔。 * * * ## Type Documentation ``` QDomNode.EncodingPolicy ``` 此枚舉指定如何[QDomNode.save](qdomnode.html#save)()確定序列化時使用何種編碼。 | Constant | Value | Description | | --- | --- | --- | | `QDomNode.EncodingFromDocument` | `1` | 該編碼是從文件中取出。 | | `QDomNode.EncodingFromTextStream` | `2` | 該編碼是從取出[QTextStream](qtextstream.html)。 | 另見的過載[save](qdomnode.html#save)( )函數,它接受一個EncodingPolicy 。 這個枚舉被引入或修改的Qt 4.3 。 ``` QDomNode.NodeType ``` 這個枚舉變量定義了節點的類型: | Constant | Value | Description | | --- | --- | --- | | `QDomNode.ElementNode` | `1` | ? | | `QDomNode.AttributeNode` | `2` | ? | | `QDomNode.TextNode` | `3` | ? | | `QDomNode.CDATASectionNode` | `4` | ? | | `QDomNode.EntityReferenceNode` | `5` | ? | | `QDomNode.EntityNode` | `6` | ? | | `QDomNode.ProcessingInstructionNode` | `7` | ? | | `QDomNode.CommentNode` | `8` | ? | | `QDomNode.DocumentNode` | `9` | ? | | `QDomNode.DocumentTypeNode` | `10` | ? | | `QDomNode.DocumentFragmentNode` | `11` | ? | | `QDomNode.NotationNode` | `12` | ? | | `QDomNode.BaseNode` | `21` | A [QDomNode](qdomnode.html)對象,即,不是一個[QDomNode](qdomnode.html)子類。 | | `QDomNode.CharacterDataNode` | `22` | ? | * * * ## Method Documentation ``` QDomNode.__init__ (self) ``` 構造一個[null](qdomnode.html#isNull)節點。 ``` QDomNode.__init__ (self, QDomNode) ``` 構造的副本_n_。 副本的數據是共享的(淺拷貝) :修改一個節點也將改變其他。如果你想使一個深拷貝,使用[cloneNode](qdomnode.html#cloneNode)( ) 。 ``` QDomNode QDomNode.appendChild (self, QDomNode?newChild) ``` [ 追加可_newChild_作為節點的最后一個子。 If _newChild_是另一個節點的子節點,它被重設父到該節點。如果_newChild_是這個節點的子節點,然后其在兒童中的列表中的位置被改變。 ](qdomnode.html) [If _newChild_是](qdomnode.html)[QDomDocumentFragment](qdomdocumentfragment.html),然后該片段的孩子從片段取出并追加。 If _newChild_是[QDomElement](qdomelement.html)與該節點是[QDomDocument](qdomdocument.html)已經有一個元素節點作為一個孩子,_newChild_不添加作為一個孩子,一個空節點返回。 返回一個新的參考_newChild_成功或[null node](qdomnode.html#isNull)失敗。 一個空節點(創建,例如,使用默認構造函數)在調用該函數不執行任何操作,并返回一個[null node](qdomnode.html#isNull)。 DOM規范不允許插入屬性節點,但由于歷史的原因, QDom接受他們無論如何。 **See also** [insertBefore](qdomnode.html#insertBefore)( )[insertAfter](qdomnode.html#insertAfter)( )[replaceChild](qdomnode.html#replaceChild)()和[removeChild](qdomnode.html#removeChild)( ) 。 ``` QDomNamedNodeMap QDomNode.attributes (self) ``` [](qdomnamednodemap.html) [將返回所有屬性的命名節點圖。僅提供了屬性](qdomnamednodemap.html)[QDomElement](qdomelement.html)秒。 變更的屬性的映射也將改變這個屬性[QDomNode](qdomnode.html)。 ``` QDomNodeList QDomNode.childNodes (self) ``` [ 將返回所有直接子節點的列表。 ](qdomnodelist.html) [大多數情況下你都會調用這個函數的](qdomnodelist.html)[QDomElement](qdomelement.html)對象。 例如,如果XML文件看起來像這樣: ``` <body> <h1>Heading</h1> <p>Hello <b>you</b></p> </body> ``` 那么對于“身體”元素的子節點列表將包含由\u003ch1\u003e標記,并由\u003cp\u003e標籤創建的節點創建的節點。 在列表中的節點不會被復制,所以改變列表中的節點也將改變這個節點的子節點。 **See also** [firstChild](qdomnode.html#firstChild)()和[lastChild](qdomnode.html#lastChild)( ) 。 ``` QDomNode.clear (self) ``` 轉換節點,進入一個空節點,如果它不是一個空節點之前,它的類型和內容將被刪除。 **See also** [isNull](qdomnode.html#isNull)( ) 。 ``` QDomNode QDomNode.cloneNode (self, bool?deep?=?True) ``` [](qdomnode.html) [創建的一個深(不淺)副本](qdomnode.html)[QDomNode](qdomnode.html)。 If _deep_是真的,那么克隆完成遞歸這意味著所有節點的子節點是深復制了。如果_deep_是假的只有節點本身被復制,并且復制將沒有子節點。 ``` int QDomNode.columnNumber (self) ``` 對于由創建節點[QDomDocument.setContent](qdomdocument.html#setContent)( ) ,這個函數返回的節點被解析的XML文檔中的列數。否則,返回-1 。 這個函數是Qt 4.1中引入。 **See also** [lineNumber](qdomnode.html#lineNumber)()和[QDomDocument.setContent](qdomdocument.html#setContent)( ) 。 ``` QDomNode QDomNode.firstChild (self) ``` [](qdomnode.html) [返回節點的第一個孩子。如果不存在子節點時,一](qdomnode.html)[null node](qdomnode.html#isNull)返回。更改返回的節點也將改變在文檔樹中的節點。 **See also** [lastChild](qdomnode.html#lastChild)()和[childNodes](qdomnode.html#childNodes)( ) 。 ``` QDomElement QDomNode.firstChildElement (self, QString?tagName?=?QString()) ``` [ 返回與標記名稱的第一個子元素_tagName_如果標記名非空,否則返回第一個子元素。返回如果沒有這樣的孩子存在一個空元素。 ](qdomelement.html) [**See also**](qdomelement.html) [lastChildElement](qdomnode.html#lastChildElement)( )[previousSiblingElement](qdomnode.html#previousSiblingElement)()和[nextSiblingElement](qdomnode.html#nextSiblingElement)( ) 。 ``` bool QDomNode.hasAttributes (self) ``` 返回True如果節點有屬性,否則返回False 。 **See also** [attributes](qdomnode.html#attributes)( ) 。 ``` bool QDomNode.hasChildNodes (self) ``` 返回True如果節點有一個或更多的孩子,否則返回False 。 ``` QDomNode QDomNode.insertAfter (self, QDomNode?newChild, QDomNode?refChild) ``` [](qdomnode.html) [插入節點_newChild_子節點之后_refChild_。_refChild_必須是此節點的直接子。如果_refChild_ is](qdomnode.html) [null](qdomnode.html#isNull)然后_newChild_被追加為這個節點的最后一個子節點。 If _newChild_是另一個節點的子節點,它被重設父到該節點。如果_newChild_是這個節點的子節點,然后其在兒童中的列表中的位置被改變。 If _newChild_是[QDomDocumentFragment](qdomdocumentfragment.html),然后該片段的孩子從片段除去后插入_refChild_。 返回一個新的參考_newChild_成功或[null node](qdomnode.html#isNull)失敗。 DOM規范不允許插入屬性節點,但由于歷史的原因QDom接受他們不過。 **See also** [insertBefore](qdomnode.html#insertBefore)( )[replaceChild](qdomnode.html#replaceChild)( )[removeChild](qdomnode.html#removeChild)()和[appendChild](qdomnode.html#appendChild)( ) 。 ``` QDomNode QDomNode.insertBefore (self, QDomNode?newChild, QDomNode?refChild) ``` [](qdomnode.html) [插入節點_newChild_該子節點之前_refChild_。_refChild_必須是此節點的直接子。如果_refChild_ is](qdomnode.html) [null](qdomnode.html#isNull)然后_newChild_插入為節點的第一個孩子。 If _newChild_是另一個節點的子節點,它被重設父到該節點。如果_newChild_是這個節點的子節點,然后其在兒童中的列表中的位置被改變。 If _newChild_是[QDomDocumentFragment](qdomdocumentfragment.html),然后該片段的孩子從片段取出并插入前_refChild_。 返回一個新的參考_newChild_成功或[null node](qdomnode.html#isNull)失敗。 DOM規范不允許插入屬性節點,但由于歷史的原因QDom接受他們不過。 **See also** [insertAfter](qdomnode.html#insertAfter)( )[replaceChild](qdomnode.html#replaceChild)( )[removeChild](qdomnode.html#removeChild)()和[appendChild](qdomnode.html#appendChild)( ) 。 ``` bool QDomNode.isAttr (self) ``` 返回True如果該節點是一個屬性,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個QDomAttribute ,你可以得到QDomAttribute與toAttribute ( ) 。 **See also** [toAttr](qdomnode.html#toAttr)( ) 。 ``` bool QDomNode.isCDATASection (self) ``` 返回True如果該節點是一個CDATA部分,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomCDATASection](qdomcdatasection.html),你可以得到[QDomCDATASection](qdomcdatasection.html)同[toCDATASection](qdomnode.html#toCDATASection)( ) 。 **See also** [toCDATASection](qdomnode.html#toCDATASection)( ) 。 ``` bool QDomNode.isCharacterData (self) ``` 返回True如果該節點是一個字符數據節點,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomCharacterData](qdomcharacterdata.html),你可以得到[QDomCharacterData](qdomcharacterdata.html)同[toCharacterData](qdomnode.html#toCharacterData)( ) 。 **See also** [toCharacterData](qdomnode.html#toCharacterData)( ) 。 ``` bool QDomNode.isComment (self) ``` 返回True如果該節點是注釋,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomComment](qdomcomment.html),你可以得到[QDomComment](qdomcomment.html)同[toComment](qdomnode.html#toComment)( ) 。 **See also** [toComment](qdomnode.html#toComment)( ) 。 ``` bool QDomNode.isDocument (self) ``` 返回True如果該節點是一個文件,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomDocument](qdomdocument.html),你可以得到[QDomDocument](qdomdocument.html)同[toDocument](qdomnode.html#toDocument)( ) 。 **See also** [toDocument](qdomnode.html#toDocument)( ) 。 ``` bool QDomNode.isDocumentFragment (self) ``` 返回True如果該節點是文檔片段,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomDocumentFragment](qdomdocumentfragment.html),你可以得到[QDomDocumentFragment](qdomdocumentfragment.html)同[toDocumentFragment](qdomnode.html#toDocumentFragment)( ) 。 **See also** [toDocumentFragment](qdomnode.html#toDocumentFragment)( ) 。 ``` bool QDomNode.isDocumentType (self) ``` 返回True如果該節點是一個文檔類型,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomDocumentType](qdomdocumenttype.html),你可以得到[QDomDocumentType](qdomdocumenttype.html)同[toDocumentType](qdomnode.html#toDocumentType)( ) 。 **See also** [toDocumentType](qdomnode.html#toDocumentType)( ) 。 ``` bool QDomNode.isElement (self) ``` 返回True如果該節點是一個元素,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomElement](qdomelement.html),你可以得到[QDomElement](qdomelement.html)同[toElement](qdomnode.html#toElement)( ) 。 **See also** [toElement](qdomnode.html#toElement)( ) 。 ``` bool QDomNode.isEntity (self) ``` 返回True如果該節點是一個實體,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomEntity](qdomentity.html),你可以得到[QDomEntity](qdomentity.html)同[toEntity](qdomnode.html#toEntity)( ) 。 **See also** [toEntity](qdomnode.html#toEntity)( ) 。 ``` bool QDomNode.isEntityReference (self) ``` 返回True如果該節點是一個實體引用,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomEntityReference](qdomentityreference.html),你可以得到[QDomEntityReference](qdomentityreference.html)同[toEntityReference](qdomnode.html#toEntityReference)( ) 。 **See also** [toEntityReference](qdomnode.html#toEntityReference)( ) 。 ``` bool QDomNode.isNotation (self) ``` 返回True如果該節點是一個符號,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomNotation](qdomnotation.html),你可以得到[QDomNotation](qdomnotation.html)同[toNotation](qdomnode.html#toNotation)( ) 。 **See also** [toNotation](qdomnode.html#toNotation)( ) 。 ``` bool QDomNode.isNull (self) ``` 如果此節點為空,則返回True (即,如果它沒有類型或內容),否則返回False 。 ``` bool QDomNode.isProcessingInstruction (self) ``` 返回True如果該節點是一個處理指令,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomProcessingInstruction](qdomprocessinginstruction.html),你可以得到QProcessingInstruction與[toProcessingInstruction](qdomnode.html#toProcessingInstruction)( ) 。 **See also** [toProcessingInstruction](qdomnode.html#toProcessingInstruction)( ) 。 ``` bool QDomNode.isSupported (self, QString?feature, QString?version) ``` DOM實現是否實現該功能,則返回True_feature_而這個功能是支持在版本這個節點_version_否則返回False 。 **See also** [QDomImplementation.hasFeature](qdomimplementation.html#hasFeature)( ) 。 ``` bool QDomNode.isText (self) ``` 返回True如果該節點是一個文本節點,否則返回False 。 如果這個函數返回True ,這并不意味著該對象是一個[QDomText](qdomtext.html),你可以得到[QDomText](qdomtext.html)同[toText](qdomnode.html#toText)( ) 。 **See also** [toText](qdomnode.html#toText)( ) 。 ``` QDomNode QDomNode.lastChild (self) ``` [](qdomnode.html) [返回節點的最后一個子。如果不存在子節點時,一](qdomnode.html)[null node](qdomnode.html#isNull)返回。更改返回的節點也將改變在文檔樹中的節點。 **See also** [firstChild](qdomnode.html#firstChild)()和[childNodes](qdomnode.html#childNodes)( ) 。 ``` QDomElement QDomNode.lastChildElement (self, QString?tagName?=?QString()) ``` [ 返回最后一個子元素與標籤名_tagName_如果標記名非空,否則返回最后一個子元素。返回如果沒有這樣的孩子存在一個空元素。 ](qdomelement.html) [**See also**](qdomelement.html) [firstChildElement](qdomnode.html#firstChildElement)( )[previousSiblingElement](qdomnode.html#previousSiblingElement)()和[nextSiblingElement](qdomnode.html#nextSiblingElement)( ) 。 ``` int QDomNode.lineNumber (self) ``` 對于由創建節點[QDomDocument.setContent](qdomdocument.html#setContent)( ) ,這個函數返回的節點被解析的XML文檔中的行號。否則,返回-1 。 這個函數是Qt 4.1中引入。 **See also** [columnNumber](qdomnode.html#columnNumber)()和[QDomDocument.setContent](qdomdocument.html#setContent)( ) 。 ``` QString QDomNode.localName (self) ``` 如果節點使用命名空間,這個函數返回節點的本地名稱,否則返回一個空字符串。 類型的唯一節點[ElementNode](qdomnode.html#NodeType-enum) or [AttributeNode](qdomnode.html#NodeType-enum)可以有命名空間。命名空間必須被指定在創建時,它是不可能事后添加的命名空間。 [QDomDocument.createAttributeNS](qdomdocument.html#createAttributeNS)( ) **See also** [prefix](qdomnode.html#prefix)( )[namespaceURI](qdomnode.html#namespaceURIx)()和[QDomDocument.createElementNS](qdomdocument.html#createElementNS)( ) 。 ``` QDomNode QDomNode.namedItem (self, QString?name) ``` [](qdomnode.html) [返回的第一個直接子節點](qdomnode.html)[nodeName](qdomnode.html#nodeName)( )等于_name_。 如果沒有這樣的直接子存在,一[null node](qdomnode.html#isNull)返回。 **See also** [nodeName](qdomnode.html#nodeName)( ) 。 ``` QString QDomNode.namespaceURI (self) ``` ``` QDomNode QDomNode.nextSibling (self) ``` [ 返回在文檔樹中的下一個同級。更改返回的節點也將改變在文檔樹中的節點。 如果你有這樣的XML : ``` <h1>Heading</h1> <p>The text...</p> <h2>Next heading</h2> ``` ](qdomnode.html) [這](qdomnode.html)[QDomNode](qdomnode.html)代表\u003cp\u003e標籤, nextSibling ( )將返回一個代表該\u003cH2\u003e標籤的節點。 **See also** [previousSibling](qdomnode.html#previousSibling)( ) 。 ``` QDomElement QDomNode.nextSiblingElement (self, QString?tagName?=?QString()) ``` [ 返回下一個同級元素與標籤名_tagName_如果_tagName_非空,否則返回任何一個同級元素。返回如果沒有這樣的兄弟姐妹存在一個空元素。 ](qdomelement.html) [**See also**](qdomelement.html) [firstChildElement](qdomnode.html#firstChildElement)( )[previousSiblingElement](qdomnode.html#previousSiblingElement)()和[lastChildElement](qdomnode.html#lastChildElement)( ) 。 ``` QString QDomNode.nodeName (self) ``` 返回節點的名稱。 這個名字的含義依賴于子類: | Name | Meaning | | --- | --- | | [QDomAttr](qdomattr.html) | The name of the attribute | | [QDomCDATASection](qdomcdatasection.html) | The string "#cdata-section" | | [QDomComment](qdomcomment.html) | The string "#comment" | | [QDomDocument](qdomdocument.html) | The string "#document" | | [QDomDocumentFragment](qdomdocumentfragment.html) | The string "#document-fragment" | | [QDomDocumentType](qdomdocumenttype.html) | The name of the document type | | [QDomElement](qdomelement.html) | The tag name | | [QDomEntity](qdomentity.html) | The name of the entity | | [QDomEntityReference](qdomentityreference.html) | The name of the referenced entity | | [QDomNotation](qdomnotation.html) | The name of the notation | | [QDomProcessingInstruction](qdomprocessinginstruction.html) | The target of the processing instruction | | [QDomText](qdomtext.html) | The string "#text" | **Note:**處理元素和屬性節點的名稱時,此功能不采取命名空間的存在考慮。因此,返回的名稱可以包含任何命名空間前綴可能存在。為了獲得一個元素或屬性的節點名,使用[localName](qdomnode.html#localName)();獲得命名空間前綴,使用[namespaceURI](qdomnode.html#namespaceURIx)( ) 。 **See also** [nodeValue](qdomnode.html#nodeValue)( ) 。 ``` NodeType QDomNode.nodeType (self) ``` [ 返回節點的類型。 ](qdomnode.html#NodeType-enum) [**See also**](qdomnode.html#NodeType-enum) [toAttr](qdomnode.html#toAttr)( )[toCDATASection](qdomnode.html#toCDATASection)( )[toDocumentFragment](qdomnode.html#toDocumentFragment)( )[toDocument](qdomnode.html#toDocument)( )[toDocumentType](qdomnode.html#toDocumentType)( )[toElement](qdomnode.html#toElement)( )[toEntityReference](qdomnode.html#toEntityReference)( )[toText](qdomnode.html#toText)( )[toEntity](qdomnode.html#toEntity)( )[toNotation](qdomnode.html#toNotation)( )[toProcessingInstruction](qdomnode.html#toProcessingInstruction)( )[toCharacterData](qdomnode.html#toCharacterData)()和[toComment](qdomnode.html#toComment)( ) 。 ``` QString QDomNode.nodeValue (self) ``` 返回節點的值。 該值的含義依賴于子類: | Name | Meaning | | --- | --- | | [QDomAttr](qdomattr.html) | The attribute value | | [QDomCDATASection](qdomcdatasection.html) | The content of the CDATA section | | [QDomComment](qdomcomment.html) | The comment | | [QDomProcessingInstruction](qdomprocessinginstruction.html) | The data of the processing instruction | | [QDomText](qdomtext.html) | The text | 所有其他子類沒有一個節點值,將返回一個空字符串。 **See also** [setNodeValue](qdomnode.html#setNodeValue)()和[nodeName](qdomnode.html#nodeName)( ) 。 ``` QDomNode.normalize (self) ``` 調用正常化( )的元素及其所有子轉換成標準格式。這意味著相鄰的[QDomText](qdomtext.html)對象將被合并成一個單一的文本對象([QDomCDATASection](qdomcdatasection.html)節點未合并) 。 ``` QDomDocument QDomNode.ownerDocument (self) ``` [ 返回此節點所屬的文檔。 ](qdomdocument.html) ``` QDomNode QDomNode.parentNode (self) ``` [](qdomnode.html) [返回父節點。如果該節點沒有父級,則返回一個空節點(即該節點](qdomnode.html)[isNull](qdomnode.html#isNull)( )返回True ) 。 ``` QString QDomNode.prefix (self) ``` 返回節點或空字符串的命名空間前綴,如果該節點沒有命名空間前綴。 類型的唯一節點[ElementNode](qdomnode.html#NodeType-enum) or [AttributeNode](qdomnode.html#NodeType-enum)可以有命名空間。命名空間前綴必須在創建時指定。如果一個節點是用命名空間前綴創建的,則可以在以后改變它[setPrefix](qdomnode.html#setPrefix)( ) 。 如果您創建一個元素或屬性[QDomDocument.createElement](qdomdocument.html#createElement)()或[QDomDocument.createAttribute](qdomdocument.html#createAttribute)( ) ,前綴將是一個空字符串。如果你使用[QDomDocument.createElementNS](qdomdocument.html#createElementNS)()或[QDomDocument.createAttributeNS](qdomdocument.html#createAttributeNS)()代替,前綴不會是一個空字符串,但它可能是一個空字符串,如果該名稱沒有前綴。 [QDomDocument.createElementNS](qdomdocument.html#createElementNS)( )[QDomDocument.createAttributeNS](qdomdocument.html#createAttributeNS)( ) **See also** [setPrefix](qdomnode.html#setPrefix)( )[localName](qdomnode.html#localName)()和[namespaceURI](qdomnode.html#namespaceURIx)( ) 。 ``` QDomNode QDomNode.previousSibling (self) ``` [ 返回在文檔樹中的前一個同級。更改返回的節點也將改變在文檔樹中的節點。 例如,如果你有這樣的XML : ``` <h1>Heading</h1> <p>The text...</p> <h2>Next heading</h2> ``` ](qdomnode.html) [這](qdomnode.html)[QDomNode](qdomnode.html)代表\u003cp\u003e標籤, previousSibling ( )將返回一個代表該\u003ch1\u003e標記的節點。 **See also** [nextSibling](qdomnode.html#nextSibling)( ) 。 ``` QDomElement QDomNode.previousSiblingElement (self, QString?tagName?=?QString()) ``` [ 返回前sibilng元素與標籤名_tagName_如果_tagName_非空,否則返回任何一個同級元素。返回如果沒有這樣的兄弟姐妹存在一個空元素。 ](qdomelement.html) [**See also**](qdomelement.html) [firstChildElement](qdomnode.html#firstChildElement)( )[nextSiblingElement](qdomnode.html#nextSiblingElement)()和[lastChildElement](qdomnode.html#lastChildElement)( ) 。 ``` QDomNode QDomNode.removeChild (self, QDomNode?oldChild) ``` [ 移除_oldChild_從孩子的列表。_oldChild_必須是此節點的直接子。 ](qdomnode.html) [返回一個新的參考_oldChild_成功或](qdomnode.html)[null node](qdomnode.html#isNull)失敗。 **See also** [insertBefore](qdomnode.html#insertBefore)( )[insertAfter](qdomnode.html#insertAfter)( )[replaceChild](qdomnode.html#replaceChild)()和[appendChild](qdomnode.html#appendChild)( ) 。 ``` QDomNode QDomNode.replaceChild (self, QDomNode?newChild, QDomNode?oldChild) ``` [ 替換_oldChild_同_newChild_。_oldChild_必須是此節點的直接子。 If _newChild_是另一個節點的子節點,它被重設父到該節點。如果_newChild_是這個節點的子節點,然后其在兒童中的列表中的位置被改變。 ](qdomnode.html) [If _newChild_是](qdomnode.html)[QDomDocumentFragment](qdomdocumentfragment.html),然后_oldChild_被替換的所有片段的孩子。 返回一個新的參考_oldChild_成功或[null node](qdomnode.html#isNull)一個失敗。 **See also** [insertBefore](qdomnode.html#insertBefore)( )[insertAfter](qdomnode.html#insertAfter)( )[removeChild](qdomnode.html#removeChild)()和[appendChild](qdomnode.html#appendChild)( ) 。 ``` QDomNode.save (self, QTextStream, int) ``` 寫入節點的XML表示形式及其所有子到流_str_。此函數使用_indent_作為空間縮進量的節點。 如果這個節點是一個文檔節點,文本流的編碼_str_的編碼是由名為“ xml”的治療處理指令的XML聲明,如果這樣的人存在,否則默認為UTF - 8設置。 XML聲明不是處理指令,但存在由于歷史原因,這個行為。如果這個節點不是一個文檔節點,文本流的編碼。 如果文檔中包含無效的XML字符或不能在給定的編碼進行編碼的字符,結果和行為是不確定的。 ``` QDomNode.save (self, QTextStream, int, EncodingPolicy) ``` If _encodingPolicy_ is [QDomNode.EncodingFromDocument](qdomnode.html#EncodingPolicy-enum)這個函數的作用是保存([QTextStream](qtextstream.html)&海峽,詮釋縮進) 。 If _encodingPolicy_ is [EncodingFromTextStream](qdomnode.html#EncodingPolicy-enum)而這個節點是一個文檔節點,這個函數的行為就像保存([QTextStream](qtextstream.html)&海峽,詮釋縮進)除了在文本流中指定的編碼_str_被使用。 如果文檔中包含無效的XML字符或不能在給定的編碼進行編碼的字符,結果和行為是不確定的。 這個函數中引入了Qt 4.2中。 ``` QDomNode.setNodeValue (self, QString) ``` 設置節點的值_v_。 **See also** [nodeValue](qdomnode.html#nodeValue)( ) 。 ``` QDomNode.setPrefix (self, QString?pre) ``` 如果該節點有一個命名空間前綴,這個功能改變了節點的命名空間前綴_pre_。否則,這個函數不執行任何操作。 類型的唯一節點[ElementNode](qdomnode.html#NodeType-enum) or [AttributeNode](qdomnode.html#NodeType-enum)可以有命名空間。命名空間前綴必須要在創建時指定的,它是不可能添加一個命名空間前綴之后。 [QDomDocument.createElementNS](qdomdocument.html#createElementNS)( )[QDomDocument.createAttributeNS](qdomdocument.html#createAttributeNS)( ) **See also** [prefix](qdomnode.html#prefix)( )[localName](qdomnode.html#localName)()和[namespaceURI](qdomnode.html#namespaceURIx)( ) 。 ``` QDomAttr QDomNode.toAttr (self) ``` [](qdomattr.html) [將一個](qdomattr.html)[QDomNode](qdomnode.html)成[QDomAttr](qdomattr.html)。如果節點不是一個屬性,返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isAttr](qdomnode.html#isAttr)( ) 。 ``` QDomCDATASection QDomNode.toCDATASection (self) ``` [](qdomcdatasection.html) [將一個](qdomcdatasection.html)[QDomNode](qdomnode.html)成[QDomCDATASection](qdomcdatasection.html)。如果該節點不是一個CDATA節,返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isCDATASection](qdomnode.html#isCDATASection)( ) 。 ``` QDomCharacterData QDomNode.toCharacterData (self) ``` [](qdomcharacterdata.html) [將一個](qdomcharacterdata.html)[QDomNode](qdomnode.html)成[QDomCharacterData](qdomcharacterdata.html)。如果該節點不是一個字符數據節點返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isCharacterData](qdomnode.html#isCharacterData)( ) 。 ``` QDomComment QDomNode.toComment (self) ``` [](qdomcomment.html) [將一個](qdomcomment.html)[QDomNode](qdomnode.html)成[QDomComment](qdomcomment.html)。如果該節點是不是注釋返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isComment](qdomnode.html#isComment)( ) 。 ``` QDomDocument QDomNode.toDocument (self) ``` [](qdomdocument.html) [將一個](qdomdocument.html)[QDomNode](qdomnode.html)成[QDomDocument](qdomdocument.html)。如果該節點不是文檔返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isDocument](qdomnode.html#isDocument)( ) 。 ``` QDomDocumentFragment QDomNode.toDocumentFragment (self) ``` [](qdomdocumentfragment.html) [將一個](qdomdocumentfragment.html)[QDomNode](qdomnode.html)成[QDomDocumentFragment](qdomdocumentfragment.html)。如果該節點不是一個文檔片段返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isDocumentFragment](qdomnode.html#isDocumentFragment)( ) 。 ``` QDomDocumentType QDomNode.toDocumentType (self) ``` [](qdomdocumenttype.html) [將一個](qdomdocumenttype.html)[QDomNode](qdomnode.html)成[QDomDocumentType](qdomdocumenttype.html)。如果該節點不是文檔類型返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isDocumentType](qdomnode.html#isDocumentType)( ) 。 ``` QDomElement QDomNode.toElement (self) ``` [](qdomelement.html) [將一個](qdomelement.html)[QDomNode](qdomnode.html)成[QDomElement](qdomelement.html)。如果節點不是元素返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isElement](qdomnode.html#isElement)( ) 。 ``` QDomEntity QDomNode.toEntity (self) ``` [](qdomentity.html) [將一個](qdomentity.html)[QDomNode](qdomnode.html)成[QDomEntity](qdomentity.html)。如果節點不是一個實體返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isEntity](qdomnode.html#isEntity)( ) 。 ``` QDomEntityReference QDomNode.toEntityReference (self) ``` [](qdomentityreference.html) [將一個](qdomentityreference.html)[QDomNode](qdomnode.html)成[QDomEntityReference](qdomentityreference.html)。如果節點不是一個實體引用,返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isEntityReference](qdomnode.html#isEntityReference)( ) 。 ``` QDomNotation QDomNode.toNotation (self) ``` [](qdomnotation.html) [將一個](qdomnotation.html)[QDomNode](qdomnode.html)成[QDomNotation](qdomnotation.html)。如果該節點不是一個符號返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isNotation](qdomnode.html#isNotation)( ) 。 ``` QDomProcessingInstruction QDomNode.toProcessingInstruction (self) ``` [](qdomprocessinginstruction.html) [將一個](qdomprocessinginstruction.html)[QDomNode](qdomnode.html)成[QDomProcessingInstruction](qdomprocessinginstruction.html)。如果節點不是處理指令返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isProcessingInstruction](qdomnode.html#isProcessingInstruction)( ) 。 ``` QDomText QDomNode.toText (self) ``` [](qdomtext.html) [將一個](qdomtext.html)[QDomNode](qdomnode.html)成[QDomText](qdomtext.html)。如果該節點不是文本,返回的對象將是[null](qdomnode.html#isNull)。 **See also** [isText](qdomnode.html#isText)( ) 。 ``` bool QDomNode.__eq__ (self, QDomNode) ``` ``` bool QDomNode.__ne__ (self, QDomNode) ```
                  <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>

                              哎呀哎呀视频在线观看