Movatterモバイル変換


[0]ホーム

URL:


    Dom\NodeList »
    « Dom\NamespaceInfo

    The Dom\Node class

    (PHP 8 >= 8.4.0)

    Introduction

    This is the modern, spec-compliant equivalent ofDOMNode.

    Class synopsis

    classDom\Node {
    /* Constants */
    /* Properties */
    publicreadonlyint$nodeType;
    publicreadonlystring$nodeName;
    publicreadonlystring$baseURI;
    publicreadonlybool$isConnected;
    publicreadonly?Dom\Node$parentNode;
    publicreadonly?Dom\Node$firstChild;
    publicreadonly?Dom\Node$lastChild;
    publicreadonly?Dom\Node$previousSibling;
    publicreadonly?Dom\Node$nextSibling;
    /* Methods */
    /* Not documented yet */
    }

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

    Properties

    nodeType

    Gets the type of the node. One of the predefinedXML_*_NODE constants

    nodeName
    Returns the most accurate name for the current node type.
    • For elements, this is the HTML-uppercased qualified name.
    • For attributes, this is the qualified name.
    • For processing instructions, this is the target.
    • For document type nodes, this is the name.
    baseURI

    The absolute base URI of this node ornull if the implementation wasn't able to obtain an absolute URI.

    isConnected

    Whether the node is connected to a document

    ownerDocument
    TheDom\Document object associated with this node, ornull if this node is a document.
    parentNode

    The parent of this node. If there is no such node, this returnsnull.

    parentElement

    The parent element of this element. If there is no such element, this returnsnull.

    childNodes
    ADom\NodeList that contains all children of this node. If there are no children, this is an emptyDom\NodeList.
    firstChild

    The first child of this node. If there is no such node, this returnsnull.

    lastChild

    The last child of this node. If there is no such node, this returnsnull.

    previousSibling

    The node immediately preceding this node. If there is no such node, this returnsnull.

    nextSibling

    The node immediately following this node. If there is no such node, this returnsnull.

    nodeValue
    The value of this node, depending on its type.
    textContent

    The text content of this node and its descendants.

    Notes

    Note: The DOM extension uses UTF-8 encoding when working with methods or properties. The parser methods auto-detect the encoding or allow the caller to specify an encoding.

    See Also

    Found A Problem?

    Learn How To Improve This PageSubmit a Pull RequestReport a Bug
    add a note

    User Contributed Notes

    There are no user contributed notes for this page.
    To Top
    and to navigate •Enter to select •Esc to close •/ to open
    PressEnter without selection to search using Google

    [8]ページ先頭

    ©2009-2025 Movatter.jp