Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Métodos protegidos | Atributos protegidos | Amigas | Funciones relacionadas
Referencia de la Clase QDomNode

The QDomNode class is the base class for all the nodes in a DOM tree.XMLMany functions in the DOM return a QDomNode. Más...

#include <qdom.h>

Diagrama de herencias de QDomNode
QDomAttr QDomAttr QDomCharacterData QDomCharacterData QDomDocument QDomDocument QDomDocumentFragment QDomDocumentFragment QDomDocumentType QDomDocumentType QDomElement QDomElement QDomEntity QDomEntity QDomEntityReference QDomEntityReference QDomNotation QDomNotation QDomProcessingInstruction QDomProcessingInstruction

Lista de todos los miembros.

Tipos públicos

enum  NodeType {
  ElementNode = 1, AttributeNode = 2, TextNode = 3, CDATASectionNode = 4,
  EntityReferenceNode = 5, EntityNode = 6, ProcessingInstructionNode = 7, CommentNode = 8,
  DocumentNode = 9, DocumentTypeNode = 10, DocumentFragmentNode = 11, NotationNode = 12,
  BaseNode = 21, CharacterDataNode = 22, ElementNode = 1, AttributeNode = 2,
  TextNode = 3, CDATASectionNode = 4, EntityReferenceNode = 5, EntityNode = 6,
  ProcessingInstructionNode = 7, CommentNode = 8, DocumentNode = 9, DocumentTypeNode = 10,
  DocumentFragmentNode = 11, NotationNode = 12, BaseNode = 21, CharacterDataNode = 22
}
enum  NodeType {
  ElementNode = 1, AttributeNode = 2, TextNode = 3, CDATASectionNode = 4,
  EntityReferenceNode = 5, EntityNode = 6, ProcessingInstructionNode = 7, CommentNode = 8,
  DocumentNode = 9, DocumentTypeNode = 10, DocumentFragmentNode = 11, NotationNode = 12,
  BaseNode = 21, CharacterDataNode = 22, ElementNode = 1, AttributeNode = 2,
  TextNode = 3, CDATASectionNode = 4, EntityReferenceNode = 5, EntityNode = 6,
  ProcessingInstructionNode = 7, CommentNode = 8, DocumentNode = 9, DocumentTypeNode = 10,
  DocumentFragmentNode = 11, NotationNode = 12, BaseNode = 21, CharacterDataNode = 22
}

Métodos públicos

 QDomNode ()
 QDomNode (const QDomNode &)
QDomNodeoperator= (const QDomNode &)
bool operator== (const QDomNode &) const
bool operator!= (const QDomNode &) const
virtual ~QDomNode ()
virtual QDomNode insertBefore (const QDomNode &newChild, const QDomNode &refChild)
virtual QDomNode insertAfter (const QDomNode &newChild, const QDomNode &refChild)
virtual QDomNode replaceChild (const QDomNode &newChild, const QDomNode &oldChild)
virtual QDomNode removeChild (const QDomNode &oldChild)
virtual QDomNode appendChild (const QDomNode &newChild)
virtual bool hasChildNodes () const
virtual QDomNode cloneNode (bool deep=TRUE) const
virtual void normalize ()
virtual bool isSupported (const QString &feature, const QString &version) const
virtual QString nodeName () const
virtual QDomNode::NodeType nodeType () const
virtual QDomNode parentNode () const
virtual QDomNodeList childNodes () const
virtual QDomNode firstChild () const
virtual QDomNode lastChild () const
virtual QDomNode previousSibling () const
virtual QDomNode nextSibling () const
virtual QDomNamedNodeMap attributes () const
virtual QDomDocument ownerDocument () const
virtual QString namespaceURI () const
virtual QString localName () const
virtual bool hasAttributes () const
virtual QString nodeValue () const
virtual void setNodeValue (const QString &)
virtual QString prefix () const
virtual void setPrefix (const QString &pre)
virtual bool isAttr () const
virtual bool isCDATASection () const
virtual bool isDocumentFragment () const
virtual bool isDocument () const
virtual bool isDocumentType () const
virtual bool isElement () const
virtual bool isEntityReference () const
virtual bool isText () const
virtual bool isEntity () const
virtual bool isNotation () const
virtual bool isProcessingInstruction () const
virtual bool isCharacterData () const
virtual bool isComment () const
QDomNode namedItem (const QString &name) const
bool isNull () const
void clear ()
QDomAttr toAttr ()
QDomCDATASection toCDATASection ()
QDomDocumentFragment toDocumentFragment ()
QDomDocument toDocument ()
QDomDocumentType toDocumentType ()
QDomElement toElement ()
QDomEntityReference toEntityReference ()
QDomText toText ()
QDomEntity toEntity ()
QDomNotation toNotation ()
QDomProcessingInstruction toProcessingInstruction ()
QDomCharacterData toCharacterData ()
QDomComment toComment ()
void save (QTextStream &, int) const
void * internalImpl () const
 QDomNode ()
 QDomNode (const QDomNode &)
QDomNodeoperator= (const QDomNode &)
bool operator== (const QDomNode &) const
bool operator!= (const QDomNode &) const
virtual ~QDomNode ()
virtual QDomNode insertBefore (const QDomNode &newChild, const QDomNode &refChild)
virtual QDomNode insertAfter (const QDomNode &newChild, const QDomNode &refChild)
virtual QDomNode replaceChild (const QDomNode &newChild, const QDomNode &oldChild)
virtual QDomNode removeChild (const QDomNode &oldChild)
virtual QDomNode appendChild (const QDomNode &newChild)
virtual bool hasChildNodes () const
virtual QDomNode cloneNode (bool deep=TRUE) const
virtual void normalize ()
virtual bool isSupported (const QString &feature, const QString &version) const
virtual QString nodeName () const
virtual QDomNode::NodeType nodeType () const
virtual QDomNode parentNode () const
virtual QDomNodeList childNodes () const
virtual QDomNode firstChild () const
virtual QDomNode lastChild () const
virtual QDomNode previousSibling () const
virtual QDomNode nextSibling () const
virtual QDomNamedNodeMap attributes () const
virtual QDomDocument ownerDocument () const
virtual QString namespaceURI () const
virtual QString localName () const
virtual bool hasAttributes () const
virtual QString nodeValue () const
virtual void setNodeValue (const QString &)
virtual QString prefix () const
virtual void setPrefix (const QString &pre)
virtual bool isAttr () const
virtual bool isCDATASection () const
virtual bool isDocumentFragment () const
virtual bool isDocument () const
virtual bool isDocumentType () const
virtual bool isElement () const
virtual bool isEntityReference () const
virtual bool isText () const
virtual bool isEntity () const
virtual bool isNotation () const
virtual bool isProcessingInstruction () const
virtual bool isCharacterData () const
virtual bool isComment () const
QDomNode namedItem (const QString &name) const
bool isNull () const
void clear ()
QDomAttr toAttr ()
QDomCDATASection toCDATASection ()
QDomDocumentFragment toDocumentFragment ()
QDomDocument toDocument ()
QDomDocumentType toDocumentType ()
QDomElement toElement ()
QDomEntityReference toEntityReference ()
QDomText toText ()
QDomEntity toEntity ()
QDomNotation toNotation ()
QDomProcessingInstruction toProcessingInstruction ()
QDomCharacterData toCharacterData ()
QDomComment toComment ()
void save (QTextStream &, int) const
void * internalImpl () const

Métodos protegidos

 QDomNode (QDomNodePrivate *)
 QDomNode (QDomNodePrivate *)

Atributos protegidos

QDomNodePrivateimpl

Amigas

class QDomDocument
class QDomDocumentType
class QDomNodeList
class QDomNamedNodeMap

Funciones relacionadas

(Observar que estas no son funciones miembro.)

QTextStreamoperator<< (QTextStream &str, const QDomNode &node)

Descripción detallada

The QDomNode class is the base class for all the nodes in a DOM tree.

XML

Many functions in the DOM return a QDomNode.

You can find out the type of a node using isAttr(), isCDATASection(), isDocumentFragment(), isDocument(), isDocumentType(), isElement(), isEntityReference(), isText(), isEntity(), isNotation(), isProcessingInstruction(), isCharacterData() and isComment().

A QDomNode can be converted into one of its subclasses using toAttr(), toCDATASection(), toDocumentFragment(), toDocument(), toDocumentType(), toElement(), toEntityReference(), toText(), toEntity(), toNotation(), toProcessingInstruction(), toCharacterData() or toComment(). You can convert a node to a null node with clear().

Copies of the QDomNode class share their data using explicit sharing. This means that modifying one node will change all copies. This is especially useful in combination with functions which return a QDomNode, e.g. firstChild(). You can make an independent (deep) copy of the node with cloneNode().

Nodes are inserted with insertBefore(), insertAfter() or appendChild(). You can replace one node with another using replaceChild() and remove a node with removeChild().

To traverse nodes use firstChild() to get a node's first child (if any), and nextSibling() to traverse. QDomNode also provides lastChild(), previousSibling() and parentNode(). To find the first child node with a particular node name use namedItem().

To find out if a node has children use hasChildNodes() and to get a list of all of a node's children use childNodes().

The node's name and value (the meaning of which varies depending on its type) is returned by nodeName() and nodeValue() respectively. The node's type is returned by nodeType(). The node's value can be set with setNodeValue().

The document to which the node belongs is returned by ownerDocument().

Adjacent QDomText nodes can be merged into a single node with normalize().

QDomElement nodes have attributes which can be retrieved with attributes().

QDomElement and QDomAttr nodes can have namespaces which can be retrieved with namespaceURI(). Their local name is retrieved with localName(), and their prefix with prefix(). The prefix can be set with setPrefix().

You can write the XML representation of the node to a text stream with save().

The following example looks for the first element in an XML document and prints the names of all the elements that are its direct children.

    QDomDocument d;
    d.setContent( someXML );
    QDomNode n = d.firstChild();
    while ( !n.isNull() ) {
        if ( n.isElement() ) {
            QDomElement e = n.toElement();
            cout << "Element name: " << e.tagName() << endl;
            break;
        }
        n = n.nextSibling();
    }

For further information about the Document Object Model see http://www.w3.org/TR/REC-DOM-Level-1/ and http://www.w3.org/TR/DOM-Level-2-Core/. For a more general introduction of the DOM implementation see the QDomDocument documentation.


Documentación de las enumeraciones miembro de la clase

This enum defines the type of the node: ElementNode AttributeNode TextNode CDATASectionNode EntityReferenceNode EntityNode ProcessingInstructionNode CommentNode DocumentNode DocumentTypeNode DocumentFragmentNode NotationNode BaseNode A QDomNode object, i.e. not a QDomNode subclass. CharacterDataNode

Valores de enumeraciones:
ElementNode 
AttributeNode 
TextNode 
CDATASectionNode 
EntityReferenceNode 
EntityNode 
ProcessingInstructionNode 
CommentNode 
DocumentNode 
DocumentTypeNode 
DocumentFragmentNode 
NotationNode 
BaseNode 
CharacterDataNode 
ElementNode 
AttributeNode 
TextNode 
CDATASectionNode 
EntityReferenceNode 
EntityNode 
ProcessingInstructionNode 
CommentNode 
DocumentNode 
DocumentTypeNode 
DocumentFragmentNode 
NotationNode 
BaseNode 
CharacterDataNode 
Valores de enumeraciones:
ElementNode 
AttributeNode 
TextNode 
CDATASectionNode 
EntityReferenceNode 
EntityNode 
ProcessingInstructionNode 
CommentNode 
DocumentNode 
DocumentTypeNode 
DocumentFragmentNode 
NotationNode 
BaseNode 
CharacterDataNode 
ElementNode 
AttributeNode 
TextNode 
CDATASectionNode 
EntityReferenceNode 
EntityNode 
ProcessingInstructionNode 
CommentNode 
DocumentNode 
DocumentTypeNode 
DocumentFragmentNode 
NotationNode 
BaseNode 
CharacterDataNode 

Documentación del constructor y destructor

QDomNode::QDomNode ( )

Constructs a null node.

QDomNode::QDomNode ( const QDomNode n)

Constructs a copy of n.

The 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().

QDomNode::~QDomNode ( ) [virtual]

Destroys the object and frees its resources.

QDomNode::QDomNode ( QDomNodePrivate n) [protected]
QDomNode::QDomNode ( )
QDomNode::QDomNode ( const QDomNode )
virtual QDomNode::~QDomNode ( ) [virtual]
QDomNode::QDomNode ( QDomNodePrivate ) [protected]

Documentación de las funciones miembro

QDomNode QDomNode::appendChild ( const QDomNode newChild) [virtual]

Appends newChild as the node's last child.

If newChild is the child of another node, it is reparented to this node. If newChild is a child of this node, then its position in the list of children is changed.

If newChild is a QDomDocumentFragment, then the children of the fragment are removed from the fragment and appended.

Returns a new reference to newChild.

Ver también:
insertBefore() insertAfter() replaceChild() removeChild()
virtual QDomNode QDomNode::appendChild ( const QDomNode newChild) [virtual]
QDomNamedNodeMap QDomNode::attributes ( ) const [virtual]

Returns a named node map of all attributes. Attributes are only provided for {QDomElement}s.

Changing the attributes in the map will also change the attributes of this QDomNode.

Reimplementado en QDomElement y QDomElement.

virtual QDomNamedNodeMap QDomNode::attributes ( ) const [virtual]

Reimplementado en QDomElement y QDomElement.

virtual QDomNodeList QDomNode::childNodes ( ) const [virtual]
QDomNodeList QDomNode::childNodes ( ) const [virtual]

Returns a list of all direct child nodes.

Most often you will call this function on a QDomElement object.

For example, if the XML document looks like this:

    <body>
    <h1>Heading</h1>
    <p>Hello <b>you</b></p>
    </body>

Then the list of child nodes for the "body"-element will contain the node created by the <h1> tag and the node created by the <p> tag.

The nodes in the list are not copied; so changing the nodes in the list will also change the children of this node.

Ver también:
firstChild() lastChild()
void QDomNode::clear ( void  )

Converts the node into a null node; if it was not a null node before, its type and contents are deleted.

Ver también:
isNull()
void QDomNode::clear ( )
QDomNode QDomNode::cloneNode ( bool  deep = TRUE) const [virtual]

Creates a deep (not shallow) copy of the QDomNode.

If deep is TRUE, then the cloning is done recursively which means that all the node's children are deep copied too. If deep is FALSE only the node itself is copied and the copy will have no child nodes.

virtual QDomNode QDomNode::cloneNode ( bool  deep = TRUE) const [virtual]
QDomNode QDomNode::firstChild ( ) const [virtual]

Returns the first 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.

Ver también:
lastChild() childNodes()
virtual QDomNode QDomNode::firstChild ( ) const [virtual]
virtual bool QDomNode::hasAttributes ( ) const [virtual]
bool QDomNode::hasAttributes ( ) const [virtual]

Returns TRUE if the node has attributes; otherwise returns FALSE.

Ver también:
attributes()
virtual bool QDomNode::hasChildNodes ( ) const [virtual]
bool QDomNode::hasChildNodes ( ) const [virtual]

Returns TRUE if the node has one or more children; otherwise returns FALSE.

virtual QDomNode QDomNode::insertAfter ( const QDomNode newChild,
const QDomNode refChild 
) [virtual]
QDomNode QDomNode::insertAfter ( const QDomNode newChild,
const QDomNode refChild 
) [virtual]

Inserts the node newChild after the child node refChild. refChild must be a direct child of this node. If refChild is null then newChild is appended as this node's last child.

If newChild is the child of another node, it is reparented to this node. If newChild is a child of this node, then its position in the list of children is changed.

If newChild is a QDomDocumentFragment, then the children of the fragment are removed from the fragment and inserted after refChild.

Returns a new reference to newChild on success or a null node on failure.

Ver también:
insertBefore() replaceChild() removeChild() appendChild()
virtual QDomNode QDomNode::insertBefore ( const QDomNode newChild,
const QDomNode refChild 
) [virtual]
QDomNode QDomNode::insertBefore ( const QDomNode newChild,
const QDomNode refChild 
) [virtual]

Inserts the node newChild before the child node refChild. refChild must be a direct child of this node. If refChild is null then newChild is inserted as the node's first child.

If newChild is the child of another node, it is reparented to this node. If newChild is a child of this node, then its position in the list of children is changed.

If newChild is a QDomDocumentFragment, then the children of the fragment are removed from the fragment and inserted before refChild.

Returns a new reference to newChild on success or a null node on failure.

Ver también:
insertAfter() replaceChild() removeChild() appendChild()
void* QDomNode::internalImpl ( ) const [inline]
void* QDomNode::internalImpl ( ) const [inline]
virtual bool QDomNode::isAttr ( ) const [virtual]

Reimplementado en QDomAttr y QDomAttr.

bool QDomNode::isAttr ( ) const [virtual]

Returns TRUE if the node is an attribute; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomAttribute; you can get the QDomAttribute with toAttribute().

Ver también:
toAttr()

Reimplementado en QDomAttr y QDomAttr.

virtual bool QDomNode::isCDATASection ( ) const [virtual]

Reimplementado en QDomCDATASection y QDomCDATASection.

bool QDomNode::isCDATASection ( ) const [virtual]

Returns TRUE if the node is a CDATA section; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomCDATASection; you can get the QDomCDATASection with toCDATASection().

Ver también:
toCDATASection()

Reimplementado en QDomCDATASection y QDomCDATASection.

bool QDomNode::isCharacterData ( ) const [virtual]

Returns TRUE if the node is a character data node; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomCharacterData; you can get the QDomCharacterData with toCharacterData().

Ver también:
toCharacterData()

Reimplementado en QDomCharacterData y QDomCharacterData.

virtual bool QDomNode::isCharacterData ( ) const [virtual]

Reimplementado en QDomCharacterData y QDomCharacterData.

bool QDomNode::isComment ( ) const [virtual]

Returns TRUE if the node is a comment; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomComment; you can get the QDomComment with toComment().

Ver también:
toComment()

Reimplementado en QDomComment y QDomComment.

virtual bool QDomNode::isComment ( ) const [virtual]

Reimplementado en QDomComment y QDomComment.

bool QDomNode::isDocument ( ) const [virtual]

Returns TRUE if the node is a document; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomDocument; you can get the QDomDocument with toDocument().

Ver también:
toDocument()

Reimplementado en QDomDocument y QDomDocument.

virtual bool QDomNode::isDocument ( ) const [virtual]

Reimplementado en QDomDocument y QDomDocument.

bool QDomNode::isDocumentFragment ( ) const [virtual]

Returns TRUE if the node is a document fragment; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomDocumentFragment; you can get the QDomDocumentFragment with toDocumentFragment().

Ver también:
toDocumentFragment()

Reimplementado en QDomDocumentFragment y QDomDocumentFragment.

virtual bool QDomNode::isDocumentFragment ( ) const [virtual]
bool QDomNode::isDocumentType ( ) const [virtual]

Returns TRUE if the node is a document type; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomDocumentType; you can get the QDomDocumentType with toDocumentType().

Ver también:
toDocumentType()

Reimplementado en QDomDocumentType y QDomDocumentType.

virtual bool QDomNode::isDocumentType ( ) const [virtual]

Reimplementado en QDomDocumentType y QDomDocumentType.

bool QDomNode::isElement ( ) const [virtual]

Returns TRUE if the node is an element; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomElement; you can get the QDomElement with toElement().

Ver también:
toElement()

Reimplementado en QDomElement y QDomElement.

virtual bool QDomNode::isElement ( ) const [virtual]

Reimplementado en QDomElement y QDomElement.

bool QDomNode::isEntity ( ) const [virtual]

Returns TRUE if the node is an entity; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomEntity; you can get the QDomEntity with toEntity().

Ver también:
toEntity()

Reimplementado en QDomEntity y QDomEntity.

virtual bool QDomNode::isEntity ( ) const [virtual]

Reimplementado en QDomEntity y QDomEntity.

bool QDomNode::isEntityReference ( ) const [virtual]

Returns TRUE if the node is an entity reference; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomEntityReference; you can get the QDomEntityReference with toEntityReference().

Ver también:
toEntityReference()

Reimplementado en QDomEntityReference y QDomEntityReference.

virtual bool QDomNode::isEntityReference ( ) const [virtual]
bool QDomNode::isNotation ( ) const [virtual]

Returns TRUE if the node is a notation; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomNotation; you can get the QDomNotation with toNotation().

Ver también:
toNotation()

Reimplementado en QDomNotation y QDomNotation.

virtual bool QDomNode::isNotation ( ) const [virtual]

Reimplementado en QDomNotation y QDomNotation.

bool QDomNode::isNull ( ) const

Returns TRUE if this node is null (i.e. if it has no type or contents); otherwise returns FALSE.

bool QDomNode::isNull ( ) const
bool QDomNode::isProcessingInstruction ( ) const [virtual]

Returns TRUE if the node is a processing instruction; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomProcessingInstruction; you can get the QProcessingInstruction with toProcessingInstruction().

Ver también:
toProcessingInstruction()

Reimplementado en QDomProcessingInstruction y QDomProcessingInstruction.

virtual bool QDomNode::isProcessingInstruction ( ) const [virtual]
virtual bool QDomNode::isSupported ( const QString feature,
const QString version 
) const [virtual]
bool QDomNode::isSupported ( const QString feature,
const QString version 
) const [virtual]

Returns TRUE if the DOM implementation implements the feature feature and this feature is supported by this node in the version version; otherwise returns FALSE.

Ver también:
QDomImplementation::hasFeature()
bool QDomNode::isText ( ) const [virtual]

Returns TRUE if the node is a text node; otherwise returns FALSE.

If this function returns TRUE, it does not imply that this object is a QDomText; you can get the QDomText with toText().

Ver también:
toText()

Reimplementado en QDomText y QDomText.

virtual bool QDomNode::isText ( ) const [virtual]

Reimplementado en QDomText y QDomText.

QDomNode QDomNode::lastChild ( ) const [virtual]

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.

Ver también:
firstChild() childNodes()
virtual QDomNode QDomNode::lastChild ( ) const [virtual]
virtual QString QDomNode::localName ( ) const [virtual]
QString QDomNode::localName ( ) const [virtual]

If the node uses namespaces, this function returns the local name of the node; otherwise it returns QString::null.

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

Ver también:
prefix() namespaceURI() QDomDocument::createElementNS() QDomDocument::createAttributeNS()
QDomNode QDomNode::namedItem ( const QString name) const

Shortcut to avoid dealing with QDomNodeList all the time.

QDomNode QDomNode::namedItem ( const QString name) const

Shortcut to avoid dealing with QDomNodeList all the time.

Returns the first direct child node for which nodeName() equals name.

If no such direct child exists, a null node is returned.

Ver también:
nodeName()
virtual QString QDomNode::namespaceURI ( ) const [virtual]
QString QDomNode::namespaceURI ( ) const [virtual]

Returns the namespace URI of this node or QString::null if the node has no namespace URI.

Only nodes of type ElementNode or AttributeNode can have namespaces. A namespace URI must be specified at creation time and cannot be changed later.

Ver también:
prefix() localName() QDomDocument::createElementNS() QDomDocument::createAttributeNS()
QDomNode QDomNode::nextSibling ( ) const [virtual]

Returns the next sibling in the document tree. Changing the returned node will also change the node in the document tree.

If you have XML like this:

    <h1>Heading</h1>
    <p>The text...</p>
    <h2>Next heading</h2>

and this QDomNode represents the <p> tag, nextSibling() will return the node representing the <h2> tag.

Ver también:
previousSibling()
virtual QDomNode QDomNode::nextSibling ( ) const [virtual]
virtual QString QDomNode::nodeName ( ) const [virtual]
QString QDomNode::nodeName ( ) const [virtual]

Returns the name of the node.

The meaning of the name depends on the subclass: 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 The string "#text"

Ver también:
nodeValue()
virtual QDomNode::NodeType QDomNode::nodeType ( ) const [virtual]
QDomNode::NodeType QDomNode::nodeType ( ) const [virtual]
virtual QString QDomNode::nodeValue ( ) const [virtual]
QString QDomNode::nodeValue ( ) const [virtual]

Returns the value of the node.

The meaning of the value depends on the subclass: Name Meaning QDomAttr The attribute value QDomCDATASection The content of the CDATA section QDomComment The comment QDomProcessingInstruction The data of the processing intruction QDomText The text

All the other subclasses do not have a node value and will return QString::null.

Ver también:
setNodeValue() nodeName()
virtual void QDomNode::normalize ( ) [virtual]
void QDomNode::normalize ( ) [virtual]

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

bool QDomNode::operator!= ( const QDomNode n) const

Returns TRUE if n and this DOM node are not equal; otherwise returns FALSE.

bool QDomNode::operator!= ( const QDomNode ) const
QDomNode & QDomNode::operator= ( const QDomNode n)

Assigns a copy of n to this DOM node.

The 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().

QDomNode& QDomNode::operator= ( const QDomNode )
bool QDomNode::operator== ( const QDomNode n) const

Returns TRUE if n and this DOM node are equal; otherwise returns FALSE.

bool QDomNode::operator== ( const QDomNode ) const
virtual QDomDocument QDomNode::ownerDocument ( ) const [virtual]
QDomDocument QDomNode::ownerDocument ( ) const [virtual]

Returns the document to which this node belongs.

QDomNode QDomNode::parentNode ( ) const [virtual]

Returns the parent node. If this node has no parent, a null node is returned (i.e. a node for which isNull() returns TRUE).

virtual QDomNode QDomNode::parentNode ( ) const [virtual]
virtual QString QDomNode::prefix ( ) const [virtual]
QString QDomNode::prefix ( ) const [virtual]

Returns the namespace prefix of the node or QString::null if the node has no namespace prefix.

Only 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().

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

Ver también:
setPrefix() localName() namespaceURI() QDomDocument::createElementNS() QDomDocument::createAttributeNS()
virtual QDomNode QDomNode::previousSibling ( ) const [virtual]
QDomNode QDomNode::previousSibling ( ) const [virtual]

Returns the previous sibling in the document tree. Changing the returned node will also change the node in the document tree.

For example, if you have XML like this:

    <h1>Heading</h1>
    <p>The text...</p>
    <h2>Next heading</h2>

and this QDomNode represents the <p> tag, previousSibling() will return the node representing the <h1> tag.

Ver también:
nextSibling()
virtual QDomNode QDomNode::removeChild ( const QDomNode oldChild) [virtual]
QDomNode QDomNode::removeChild ( const QDomNode oldChild) [virtual]

Removes oldChild from the list of children. oldChild must be a direct child of this node.

Returns a new reference to oldChild on success or a null node on failure.

Ver también:
insertBefore() insertAfter() replaceChild() appendChild()
virtual QDomNode QDomNode::replaceChild ( const QDomNode newChild,
const QDomNode oldChild 
) [virtual]
QDomNode QDomNode::replaceChild ( const QDomNode newChild,
const QDomNode oldChild 
) [virtual]

Replaces oldChild with newChild. oldChild must be a direct child of this node.

If newChild is the child of another node, it is reparented to this node. If newChild is a child of this node, then its position in the list of children is changed.

If newChild is a QDomDocumentFragment, then oldChild is replaced by all of the children of the fragment.

Returns a new reference to oldChild on success or a null node an failure.

Ver también:
insertBefore() insertAfter() removeChild() appendChild()
void QDomNode::save ( QTextStream ,
int   
) const
void QDomNode::save ( QTextStream str,
int  indent 
) const

Writes the XML representation of the node and all its children to the stream str. This function uses indent as the amount of space to indent the node.

virtual void QDomNode::setNodeValue ( const QString ) [virtual]
void QDomNode::setNodeValue ( const QString v) [virtual]

Sets the node's value to v.

Ver también:
nodeValue()
void QDomNode::setPrefix ( const QString pre) [virtual]

If the node has a namespace prefix, this function changes the namespace prefix of the node to pre. Otherwise this function does nothing.

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

Ver también:
prefix() localName() namespaceURI() QDomDocument::createElementNS() QDomDocument::createAttributeNS()
virtual void QDomNode::setPrefix ( const QString pre) [virtual]
QDomAttr QDomNode::toAttr ( )

Converts a QDomNode into a QDomAttr. If the node is not an attribute, the returned object will be null.

Ver también:
isAttr()
QDomAttr QDomNode::toAttr ( )
QDomCDATASection QDomNode::toCDATASection ( )
QDomCDATASection QDomNode::toCDATASection ( )

Converts a QDomNode into a QDomCDATASection. If the node is not a CDATA section, the returned object will be null.

Ver también:
isCDATASection()
QDomCharacterData QDomNode::toCharacterData ( )

Converts a QDomNode into a QDomCharacterData. If the node is not a character data node the returned object will be null.

Ver también:
isCharacterData()
QDomCharacterData QDomNode::toCharacterData ( )
QDomComment QDomNode::toComment ( )

Converts a QDomNode into a QDomComment. If the node is not a comment the returned object will be null.

Ver también:
isComment()
QDomComment QDomNode::toComment ( )
QDomDocument QDomNode::toDocument ( )

Converts a QDomNode into a QDomDocument. If the node is not a document the returned object will be null.

Ver también:
isDocument()
QDomDocument QDomNode::toDocument ( )
QDomDocumentFragment QDomNode::toDocumentFragment ( )
QDomDocumentFragment QDomNode::toDocumentFragment ( )

Converts a QDomNode into a QDomDocumentFragment. If the node is not a document fragment the returned object will be null.

Ver también:
isDocumentFragment()
QDomDocumentType QDomNode::toDocumentType ( )

Converts a QDomNode into a QDomDocumentType. If the node is not a document type the returned object will be null.

Ver también:
isDocumentType()
QDomDocumentType QDomNode::toDocumentType ( )
QDomElement QDomNode::toElement ( )
QDomElement QDomNode::toElement ( )

Converts a QDomNode into a QDomElement. If the node is not an element the returned object will be null.

Ver también:
isElement()
QDomEntity QDomNode::toEntity ( )

Converts a QDomNode into a QDomEntity. If the node is not an entity the returned object will be null.

Ver también:
isEntity()
QDomEntity QDomNode::toEntity ( )
QDomEntityReference QDomNode::toEntityReference ( )

Converts a QDomNode into a QDomEntityReference. If the node is not an entity reference, the returned object will be null.

Ver también:
isEntityReference()
QDomEntityReference QDomNode::toEntityReference ( )
QDomNotation QDomNode::toNotation ( )

Converts a QDomNode into a QDomNotation. If the node is not a notation the returned object will be null.

Ver también:
isNotation()
QDomNotation QDomNode::toNotation ( )
QDomProcessingInstruction QDomNode::toProcessingInstruction ( )

Converts a QDomNode into a QDomProcessingInstruction. If the node is not a processing instruction the returned object will be null.

Ver también:
isProcessingInstruction()
QDomProcessingInstruction QDomNode::toProcessingInstruction ( )
QDomText QDomNode::toText ( )
QDomText QDomNode::toText ( )

Converts a QDomNode into a QDomText. If the node is not a text, the returned object will be null.

Ver también:
isText()

Documentación de las funciones relacionadas y clases amigas

QTextStream & operator<< ( QTextStream str,
const QDomNode node 
) [related]

Writes the XML representation of the node node and all its children to the stream str.

QDomDocument [friend]
QDomDocumentType [friend]
QDomNamedNodeMap [friend]
QDomNodeList [friend]

Documentación de los datos miembro


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'