The DOMNode classDOMNode
&reftitle.classsynopsis;
DOMNode&Constants;publicconstintDOMNode::DOCUMENT_POSITION_DISCONNECTED0x1publicconstintDOMNode::DOCUMENT_POSITION_PRECEDING0x2publicconstintDOMNode::DOCUMENT_POSITION_FOLLOWING0x4publicconstintDOMNode::DOCUMENT_POSITION_CONTAINS0x8publicconstintDOMNode::DOCUMENT_POSITION_CONTAINED_BY0x10publicconstintDOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC0x20&Properties;publicreadonlystringnodeNamepublicstringnullnodeValuepublicreadonlyintnodeTypepublicreadonlyDOMNodenullparentNodepublicreadonlyDOMElementnullparentElementpublicreadonlyDOMNodeListchildNodespublicreadonlyDOMNodenullfirstChildpublicreadonlyDOMNodenulllastChildpublicreadonlyDOMNodenullpreviousSiblingpublicreadonlyDOMNodenullnextSiblingpublicreadonlyDOMNamedNodeMapnullattributespublicreadonlyboolisConnectedpublicreadonlyDOMDocumentnullownerDocumentpublicreadonlystringnullnamespaceURIpublicstringprefixpublicreadonlystringnulllocalNamepublicreadonlystringnullbaseURIpublicstringtextContent&Methods;
&reftitle.constants;
DOMNode::DOCUMENT_POSITION_DISCONNECTED
Set when the other node and reference node are not in the same tree.
DOMNode::DOCUMENT_POSITION_PRECEDING
Set when the other node precedes the reference node.
DOMNode::DOCUMENT_POSITION_FOLLOWING
Set when the other node follows the reference node.
DOMNode::DOCUMENT_POSITION_CONTAINS
Set when the other node is an ancestor of the reference node.
DOMNode::DOCUMENT_POSITION_CONTAINED_BY
Set when the other node is a descendant of the reference node.
DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
Set when the result depends on implementation-specific behaviour and
may not be portable.
This may happen with disconnected nodes or with attribute nodes.
&reftitle.properties;
nodeNameReturns the most accurate name for the current node typenodeValue
The value of this node, depending on its type.
Contrary to the W3C specification, the node value of
DOMElement nodes is equal to DOMNode::textContent instead
of &null;.
nodeTypeGets the type of the node. One of the predefined XML_*_NODE constantsparentNodeThe parent of this node. If there is no such node, this returns &null;.parentElementThe parent element of this element. If there is no such element, this returns &null;.childNodes
A DOMNodeList that contains all
children of this node. If there are no children, this is an empty
DOMNodeList.
firstChild
The first child of this node. If there is no such node, this
returns &null;.
lastChildThe last child of this node. If there is no such node, this returns &null;.previousSibling
The node immediately preceding this node. If there is no such
node, this returns &null;.
nextSibling
The node immediately following this node. If there is no such
node, this returns &null;.
attributes
A DOMNamedNodeMap containing the
attributes of this node (if it is a DOMElement)
or &null; otherwise.
isConnectedWhether the node is connected to a documentownerDocumentThe DOMDocument object associated with this node, or &null; if this node does not have an associated document (e.g. if it is detached, or if it is a DOMDocument).namespaceURIThe namespace URI of this node, or &null; if it is unspecified.prefixThe namespace prefix of this node.localNameReturns the local part of the qualified name of this node.baseURI
The absolute base URI of this node or &null; if the implementation
wasn't able to obtain an absolute URI.
textContentThe text content of this node and its descendants.
&reftitle.changelog;
&Version;&Description;8.4.0
Method DOMNode::compareDocumentPosition has
been added.
8.4.0
Constants DOMNode::DOCUMENT_POSITION_DISCONNECTED,
DOMNode::DOCUMENT_POSITION_PRECEDING,
DOMNode::DOCUMENT_POSITION_FOLLOWING,
DOMNode::DOCUMENT_POSITION_CONTAINS,
DOMNode::DOCUMENT_POSITION_CONTAINED_BY,
and
DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
have been added.
8.3.0
Methods DOMNode::contains, and
DOMNode::isEqualNode have been added.
8.3.0
Properties DOMNode::$parentElement, and
DOMNode::$isConnected have been added.
8.0.0
The unimplemented methods DOMNode::compareDocumentPosition,
DOMNode::isEqualNode,
DOMNode::getFeature,
DOMNode::setUserData and
DOMNode::getUserData have been removed.
&reftitle.notes;
&dom.note.utf8;
&reftitle.seealso;
W3C specification of Node
&reference.dom.entities.domnode;