The DOMCharacterData class

Introduction

Represents nodes with character data. No nodes directly correspond to this class, but other nodes do inherit from it.

Class synopsis

DOMCharacterData
extends DOMNode
implements DOMChildNode
/* Properties */
public string $data;
public readonly int $length;
public readonly DOMElementnull $previousElementSibling;
public readonly DOMElementnull $nextElementSibling;
/* Inherited properties */
public readonly string $nodeName;
public stringnull $nodeValue;
public readonly int $nodeType;
public readonly DOMNodenull $parentNode;
public readonly DOMElementnull $parentElement;
public readonly DOMNodeList $childNodes;
public readonly DOMNodenull $firstChild;
public readonly DOMNodenull $lastChild;
public readonly DOMNodenull $previousSibling;
public readonly DOMNodenull $nextSibling;
public readonly DOMNamedNodeMapnull $attributes;
public readonly bool $isConnected;
public readonly DOMDocumentnull $ownerDocument;
public readonly stringnull $namespaceURI;
public string $prefix;
public readonly stringnull $localName;
public readonly stringnull $baseURI;
public string $textContent;
/* Methods */
public void DOMCharacterData::after(DOMNodestring ...$nodes)
public true DOMCharacterData::appendData(string $data)
public void DOMCharacterData::before(DOMNodestring ...$nodes)
public bool DOMCharacterData::deleteData(int $offset, int $count)
public bool DOMCharacterData::insertData(int $offset, string $data)
public void DOMCharacterData::remove()
public bool DOMCharacterData::replaceData(int $offset, int $count, string $data)
public void DOMCharacterData::replaceWith(DOMNodestring ...$nodes)
public stringfalse DOMCharacterData::substringData(int $offset, int $count)
/* Inherited methods */
public DOMNodefalse appendChild(DOMNode $node)
public stringfalse C14N(
    bool $exclusive = false,
    bool $withComments = false,
    arraynull $xpath = null,
    arraynull $nsPrefixes = null
)
public intfalse C14NFile(
    string $uri,
    bool $exclusive = false,
    bool $withComments = false,
    arraynull $xpath = null,
    arraynull $nsPrefixes = null
)
public DOMNodefalse cloneNode(bool $deep = false)
public int compareDocumentPosition(DOMNode $other)
public bool contains(DOMNodeDOMNameSpaceNodenull $other)
public int getLineNo()
public stringnull getNodePath()
public DOMNode getRootNode(arraynull $options = null)
public bool hasAttributes()
public bool hasChildNodes()
public DOMNodefalse insertBefore(DOMNode $node, DOMNodenull $child = null)
public bool isDefaultNamespace(string $namespace)
public bool isEqualNode(DOMNodenull $otherNode)
public bool isSameNode(DOMNode $otherNode)
public bool isSupported(string $feature, string $version)
public stringnull lookupNamespaceURI(stringnull $prefix)
public stringnull lookupPrefix(string $namespace)
public void normalize()
public DOMNodefalse removeChild(DOMNode $child)
public DOMNodefalse replaceChild(DOMNode $node, DOMNode $child)

Properties

data

The contents of the node.

length

The length of the contents.

nextElementSibling

The next sibling element or null.

previousElementSibling

The previous sibling element or null.

Changelog

Version Description
8.0.0 The nextElementSibling and previousElementSibling properties have been added.
8.0.0 DOMCharacterData implements DOMChildNode now.
Table of Contents