📄 qdomnode.3qt
字号:
.SH "bool QDomNode::hasAttributes () const\fC [virtual]\fR"Returns TRUE if the node has attributes; otherwise returns FALSE..PPSee also attributes()..SH "bool QDomNode::hasChildNodes () const\fC [virtual]\fR"Returns TRUE if the node has one or more children; otherwise returns FALSE..SH "QDomNode QDomNode::insertAfter ( const QDomNode & newChild, const QDomNode & refChild )\fC [virtual]\fR"Inserts the node \fInewChild\fR after the child node \fIrefChild\fR. \fIrefChild\fR must be a direct child of this node. If \fIrefChild\fR is null then \fInewChild\fR is appended as this node's last child..PPIf \fInewChild\fR is the child of another node, it is reparented to this node. If \fInewChild\fR is a child of this node, then its position in the list of children is changed..PPIf \fInewChild\fR is a QDomDocumentFragment, then the children of the fragment are removed from the fragment and inserted after \fIrefChild\fR..PPReturns a new reference to \fInewChild\fR on success or a null node on failure..PPSee also insertBefore(), replaceChild(), removeChild(), and appendChild()..SH "QDomNode QDomNode::insertBefore ( const QDomNode & newChild, const QDomNode & refChild )\fC [virtual]\fR"Inserts the node \fInewChild\fR before the child node \fIrefChild\fR. \fIrefChild\fR must be a direct child of this node. If \fIrefChild\fR is null then \fInewChild\fR is inserted as the node's first child..PPIf \fInewChild\fR is the child of another node, it is reparented to this node. If \fInewChild\fR is a child of this node, then its position in the list of children is changed..PPIf \fInewChild\fR is a QDomDocumentFragment, then the children of the fragment are removed from the fragment and inserted before \fIrefChild\fR..PPReturns a new reference to \fInewChild\fR on success or a null node on failure..PPSee also insertAfter(), replaceChild(), removeChild(), and appendChild()..SH "bool QDomNode::isAttr () const\fC [virtual]\fR"Returns TRUE if the node is an attribute; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomAttribute; you can get the QDomAttribute with toAttribute()..PPSee also toAttr()..PPReimplemented in QDomAttr..SH "bool QDomNode::isCDATASection () const\fC [virtual]\fR"Returns TRUE if the node is a CDATA section; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomCDATASection; you can get the QDomCDATASection with toCDATASection()..PPSee also toCDATASection()..PPReimplemented in QDomCDATASection..SH "bool QDomNode::isCharacterData () const\fC [virtual]\fR"Returns TRUE if the node is a character data node; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomCharacterData; you can get the QDomCharacterData with toCharacterData()..PPSee also toCharacterData()..PPReimplemented in QDomCharacterData..SH "bool QDomNode::isComment () const\fC [virtual]\fR"Returns TRUE if the node is a comment; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomComment; you can get the QDomComment with toComment()..PPSee also toComment()..PPReimplemented in QDomComment..SH "bool QDomNode::isDocument () const\fC [virtual]\fR"Returns TRUE if the node is a document; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomDocument; you can get the QDomDocument with toDocument()..PPSee also toDocument()..PPReimplemented in QDomDocument..SH "bool QDomNode::isDocumentFragment () const\fC [virtual]\fR"Returns TRUE if the node is a document fragment; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomDocumentFragment; you can get the QDomDocumentFragment with toDocumentFragment()..PPSee also toDocumentFragment()..PPReimplemented in QDomDocumentFragment..SH "bool QDomNode::isDocumentType () const\fC [virtual]\fR"Returns TRUE if the node is a document type; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomDocumentType; you can get the QDomDocumentType with toDocumentType()..PPSee also toDocumentType()..PPReimplemented in QDomDocumentType..SH "bool QDomNode::isElement () const\fC [virtual]\fR"Returns TRUE if the node is an element; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomElement; you can get the QDomElement with toElement()..PPSee also toElement()..PPExample: xml/outliner/outlinetree.cpp..PPReimplemented in QDomElement..SH "bool QDomNode::isEntity () const\fC [virtual]\fR"Returns TRUE if the node is an entity; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomEntity; you can get the QDomEntity with toEntity()..PPSee also toEntity()..PPReimplemented in QDomEntity..SH "bool QDomNode::isEntityReference () const\fC [virtual]\fR"Returns TRUE if the node is an entity reference; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomEntityReference; you can get the QDomEntityReference with toEntityReference()..PPSee also toEntityReference()..PPReimplemented in QDomEntityReference..SH "bool QDomNode::isNotation () const\fC [virtual]\fR"Returns TRUE if the node is a notation; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomNotation; you can get the QDomNotation with toNotation()..PPSee also toNotation()..PPReimplemented in QDomNotation..SH "bool QDomNode::isNull () const"Returns TRUE if this node is null (i.e. if it has no type or contents); otherwise returns FALSE..PPExample: xml/outliner/outlinetree.cpp..SH "bool QDomNode::isProcessingInstruction () const\fC [virtual]\fR"Returns TRUE if the node is a processing instruction; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomProcessingInstruction; you can get the QProcessingInstruction with toProcessingInstruction()..PPSee also toProcessingInstruction()..PPReimplemented in QDomProcessingInstruction..SH "bool QDomNode::isSupported ( const QString & feature, const QString & version ) const\fC [virtual]\fR"Returns TRUE if the DOM implementation implements the feature \fIfeature\fR and this feature is supported by this node in the version \fIversion\fR; otherwise returns FALSE..PPSee also QDomImplementation::hasFeature()..SH "bool QDomNode::isText () const\fC [virtual]\fR"Returns TRUE if the node is a text node; otherwise returns FALSE..PPIf this function returns TRUE, it does not imply that this object is a QDomText; you can get the QDomText with toText()..PPSee also toText()..PPReimplemented in QDomText..SH "QDomNode QDomNode::lastChild () const\fC [virtual]\fR"Returns the last child of the node. If there is no child node, a null node is returned. Changing the returned node will also change the node in the document tree..PPSee also firstChild() and childNodes()..SH "QString QDomNode::localName () const\fC [virtual]\fR"If the node uses namespaces, this function returns the local name of the node; otherwise it returns QString::null..PPOnly nodes of type ElementNode or AttributeNode can have namespaces. A namespace must have been specified at creation time; it is not possible to add a namespace afterwards..PPSee also prefix(), namespaceURI(), QDomDocument::createElementNS(), and QDomDocument::createAttributeNS()..SH "QDomNode QDomNode::namedItem ( const QString & name ) const"Returns the first direct child node for which nodeName() equals \fIname\fR..PPIf no such direct child exists, a null node is returned..PPSee also nodeName()..SH "QString QDomNode::namespaceURI () const\fC [virtual]\fR"Returns the namespace URI of this node or QString::null if the node has no namespace URI..PPOnly nodes of type ElementNode or AttributeNode can have namespaces. A namespace URI must be specified at creation time and cannot be changed later..PPSee also prefix(), localName(), QDomDocument::createElementNS(), and QDomDocument::createAttributeNS()..SH "QDomNode QDomNode::nextSibling () const\fC [virtual]\fR"Returns the next sibling in the document tree. Changing the returned node will also change the node in the document tree..PPIf you have XML like this:.PP.nf.br <h1>Heading</h1>.br <p>The text...</p>.br <h2>Next heading</h2>.br.fiand this QDomNode represents the <p> tag, nextSibling() will return the node representing the <h2> tag..PPSee also previousSibling()..PPExample: xml/outliner/outlinetree.cpp..SH "QString QDomNode::nodeName () const\fC [virtual]\fR"Returns the name of the node..PPThe meaning of the name depends on the subclass: <center>.nf.TSl - l. Name Meaning QDomAttr The name of the attribute QDomCDATASection The string "#cdata-section" QDomComment The string "#comment" QDomDocument The string "#document" QDomDocumentFragment The string "#document-fragment" QDomDocumentType The name of the document type QDomElement The tag name QDomEntity The name of the entity QDomEntityReference The name of the referenced entity QDomNotation The name of the notation QDomProcessingInstruction The target of the processing instruction QDomText.TE.fi</center>.PPSee also nodeValue()..PPExample: xml/outliner/outlinetree.cpp..SH "QDomNode::NodeType QDomNode::nodeType () const\fC [virtual]\fR"Returns the type of the node..PPSee also toAttr(), toCDATASection(), toDocumentFragment(), toDocument(), toDocumentType(), toElement(), toEntityReference(), toText(), toEntity(), toNotation(), toProcessingInstruction(), toCharacterData(), and toComment()..PPReimplemented in QDomDocumentType, QDomDocument, QDomDocumentFragment, QDomCharacterData, QDomAttr, QDomElement, QDomNotation, QDomEntity, QDomEntityReference, and QDomProcessingInstruction..SH "QString QDomNode::nodeValue () const\fC [virtual]\fR"Returns the value of the node..PPThe meaning of the value depends on the subclass: <center>.nf.TSl - l. Name Meaning QDomAttr The attribute value QDomCDATASection The content of the CDATA section QDomComment The comment QDomProcessingInstruction The data of the processing intruction QDomText.TE.fi</center>.PPAll the other subclasses do not have a node value and will return QString::null..PPSee also setNodeValue() and nodeName()..PPExample: xml/outliner/outlinetree.cpp..SH "void QDomNode::normalize ()\fC [virtual]\fR"Calling normalize() on an element converts all its children into a standard form. This means that adjacent QDomText objects will be merged into a single text object (QDomCDATASection nodes are not merged)..SH "bool QDomNode::operator!= ( const QDomNode & n ) const"Returns TRUE if \fIn\fR and this DOM node are not equal; otherwise returns FALSE..SH "QDomNode & QDomNode::operator= ( const QDomNode & n )"Assigns a copy of \fIn\fR to this DOM node..PPThe data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use cloneNode()..SH "bool QDomNode::operator== ( const QDomNode & n ) const"Returns TRUE if \fIn\fR and this DOM node are equal; otherwise returns FALSE..SH "QDomDocument QDomNode::ownerDocument () const\fC [virtual]\fR"Returns the document to which this node belongs..SH "QDomNode QDomNode::parentNode () const\fC [virtual]\fR"Returns the parent node. If this node has no parent, a null node is returned (i.e. a node for which isNull() returns TRUE)..SH "QString QDomNode::prefix () const\fC [virtual]\fR"Returns the namespace prefix of the node or QString::null if the node has no namespace prefix..PPOnly nodes of type ElementNode or AttributeNode can have namespaces. A namespace prefix must be specified at creation time. If a node was created with a namespace prefix, you can change it later with setPrefix()..PPIf you create an element or attribute with QDomDocument::createElement() or QDomDocument::createAttribute(), the prefix will be QString::null. If you use QDomDocument::createElementNS() or QDomDocument::createAttributeNS() instead, the prefix will not be QString::null; but it might be an empty string if the name does not have a prefix..PPSee also setPrefix(), localName(), namespaceURI(), QDomDocument::createElementNS(), and QDomDocument::createAttributeNS()..SH "QDomNode QDomNode::previousSibling () const\fC [virtual]\fR"Returns the previous sibling in the document tree. Changing the returned node will also change the node in the document tree..PPFor example, if you have XML like this:.PP.nf.br <h1>Heading</h1>.br <p>The text...</p>.br <h2>Next heading</h2>.br.fiand this QDomNode represents the <p> tag, previousSibling() will return the node representing the <h1> tag..PPSee also nextSibling()..SH "QDomNode QDomNode::removeChild ( const QDomNode & oldChild )\fC [virtual]\fR"Removes \fIoldChild\fR from the list of children. \fIoldChild\fR must be a direct child of this node..PPReturns a new reference to \fIoldChild\fR on success or a null node on failure..PPSee also insertBefore(), insertAfter(), replaceChild(), and appendChild()..SH "QDomNode QDomNode::replaceChild ( const QDomNode & newChild, const QDomNode & oldChild )\fC [virtual]\fR"Replaces \fIoldChild\fR with \fInewChild\fR. \fIoldChild\fR must be a direct child of this node..PPIf \fInewChild\fR is the child of another node, it is reparented to this node. If \fInewChild\fR is a child of this node, then its position in the list of children is changed..PPIf \fInewChild\fR is a QDomDocumentFragment, then \fIoldChild\fR is replaced by all of the children of the fragment..PPReturns a new reference to \fIoldChild\fR on success or a null node an failure..PPSee also insertBefore(), insertAfter(), removeChild(), and appendChild()..SH "void QDomNode::save ( QTextStream & str, int indent ) const"Writes the XML representation of the node and all its children to the stream \fIstr\fR. This function uses \fIindent\fR as the amount of space to indent the node..SH "void QDomNode::setNodeValue ( const QString & v )\fC [virtual]\fR"Sets the node's value to \fIv\fR..PPSee also nodeValue()..SH "void QDomNode::setPrefix ( const QString & pre )\fC [virtual]\fR"If the node has a namespace prefix, this function changes the namespace prefix of the node to \fIpre\fR. Otherwise this function does nothing..PPOnly nodes of type ElementNode or AttributeNode can have namespaces. A namespace prefix must have be specified at creation time; it is not possible to add a namespace prefix afterwards..PPSee also prefix(), localName(), namespaceURI(), QDomDocument::createElementNS(), and QDomDocument::createAttributeNS()..SH "QDomAttr QDomNode::toAttr ()"Converts a QDomNode into a QDomAttr. If the node is not an attribute, the returned object will be null..PPSee also isAttr()..SH "QDomCDATASection QDomNode::toCDATASection ()"Converts a QDomNode into a QDomCDATASection. If the node is not a CDATA section, the returned object will be null..PPSee also isCDATASection()..SH "QDomCharacterData QDomNode::toCharacterData ()"Converts a QDomNode into a QDomCharacterData. If the node is not a character data node the returned object will be null..PPSee also isCharacterData()..SH "QDomComment QDomNode::toComment ()"Converts a QDomNode into a QDomComment. If the node is not a comment the returned object will be null..PPSee also isComment()..SH "QDomDocument QDomNode::toDocument ()"Converts a QDomNode into a QDomDocument. If the node is not a document the returned object will be null..PPSee also isDocument()..SH "QDomDocumentFragment QDomNode::toDocumentFragment ()"Converts a QDomNode into a QDomDocumentFragment. If the node is not a document fragment the returned object will be null..PPSee also isDocumentFragment()..SH "QDomDocumentType QDomNode::toDocumentType ()"Converts a QDomNode into a QDomDocumentType. If the node is not a document type the returned object will be null..PPSee also isDocumentType()..SH "QDomElement QDomNode::toElement ()"Converts a QDomNode into a QDomElement. If the node is not an element the returned object will be null..PPSee also isElement()..PPExample: xml/outliner/outlinetree.cpp..SH "QDomEntity QDomNode::toEntity ()"Converts a QDomNode into a QDomEntity. If the node is not an entity the returned object will be null..PPSee also isEntity()..SH "QDomEntityReference QDomNode::toEntityReference ()"Converts a QDomNode into a QDomEntityReference. If the node is not an entity reference, the returned object will be null..PPSee also isEntityReference()..SH "QDomNotation QDomNode::toNotation ()"Converts a QDomNode into a QDomNotation. If the node is not a notation the returned object will be null..PPSee also isNotation()..SH "QDomProcessingInstruction QDomNode::toProcessingInstruction ()"Converts a QDomNode into a QDomProcessingInstruction. If the node is not a processing instruction the returned object will be null..PPSee also isProcessingInstruction()..SH "QDomText QDomNode::toText ()"Converts a QDomNode into a QDomText. If the node is not a text, the returned object will be null..PPSee also isText()..SH RELATED FUNCTION DOCUMENTATION.SH "QTextStream & operator<< ( QTextStream & str, const QDomNode & node )"Writes the XML representation of the node \fInode\fR and all itschildren to the stream \fIstr\fR..SH "SEE ALSO".BR http://doc.trolltech.com/qdomnode.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qdomnode.3qt) and the Qtversion (3.1.1).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -