CharacterData
class CharacterData extends Node implements ChildNode (View source)
Represents nodes with character data. No nodes directly correspond to this class, but other nodes do inherit from it.
This is the modern, spec-compliant equivalent of DOMCharacterData.
Constants
| DOCUMENT_POSITION_DISCONNECTED |
|
| DOCUMENT_POSITION_PRECEDING |
|
| DOCUMENT_POSITION_FOLLOWING |
|
| DOCUMENT_POSITION_CONTAINS |
|
| DOCUMENT_POSITION_CONTAINED_BY |
|
| DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
|
Properties
| int | $nodeType | from Node | |
| string | $nodeName | from Node | |
| string | $baseURI | from Node | |
| bool | $isConnected | from Node | |
| Document|null | $ownerDocument | from Node | |
| Node|null | $parentNode | from Node | |
| Element|null | $parentElement | from Node | |
| Node> | $childNodes | from Node | |
| Node|null | $firstChild | from Node | |
| Node|null | $lastChild | from Node | |
| Node|null | $previousSibling | from Node | |
| Node|null | $nextSibling | from Node | |
| string|null | $nodeValue | from Node | |
| string|null | $textContent | from Node | |
| Element|null | $previousElementSibling | ||
| Element|null | $nextElementSibling | ||
| string | $data | ||
| int | $length |
Methods
No description
No description
Extracts a range of data from the character data
Append the string to the end of the character data of the node
Insert a string at the specified UTF-8 codepoint offset
Remove a range of characters from the character data
Replace a substring within the character data
Removes the character data node
Details
in
Node at line 423
Node
getRootNode(array $options = [])
No description
in
Node at line 427
bool
hasChildNodes()
No description
in
Node at line 438
void
normalize()
No description
in
Node at line 440
Node
cloneNode(bool $deep = false)
No description
in
Node at line 442
bool
isEqualNode(Node|null $otherNode)
No description
in
Node at line 444
bool
isSameNode(Node|null $otherNode)
No description
in
Node at line 452
int
compareDocumentPosition(Node $other)
No description
in
Node at line 454
bool
contains(Node|null $other)
No description
in
Node at line 456
string|null
lookupPrefix(string|null $namespace)
No description
in
Node at line 458
string|null
lookupNamespaceURI(string|null $prefix)
No description
in
Node at line 460
bool
isDefaultNamespace(string|null $namespace)
No description
in
Node at line 462
Node
insertBefore(Node $node, Node|null $child)
No description
in
Node at line 464
Node
appendChild(Node $node)
No description
in
Node at line 466
Node
replaceChild(Node $node, Node $child)
No description
in
Node at line 468
Node
removeChild(Node $child)
No description
in
Node at line 470
int
getLineNo()
No description
in
Node at line 472
string
getNodePath()
No description
in
Node at line 474
string|false
C14N(bool $exclusive = false, bool $withComments = false, array|null $xpath = null, array|null $nsPrefixes = null)
No description
in
Node at line 476
int|false
C14NFile(string $uri, bool $exclusive = false, bool $withComments = false, array|null $xpath = null, array|null $nsPrefixes = null)
No description
in
Node at line 478
array
__sleep()
No description
in
Node at line 480
void
__wakeup()
No description
string
substringData(int $offset, int $count)
Extracts a range of data from the character data
Returns the specified substring.
void
appendData(string $data)
Append the string to the end of the character data of the node
Append the string data to the end of the character data of the node.
void
insertData(int $offset, string $data)
Insert a string at the specified UTF-8 codepoint offset
Inserts string data at position offset.
void
deleteData(int $offset, int $count)
Remove a range of characters from the character data
Deletes count characters starting from position offset.
void
replaceData(int $offset, int $count, string $data)
Replace a substring within the character data
Replace count characters starting from position offset with data.
void
remove()
Removes the character data node
void
before(Node|string ...$nodes)
Adds nodes before the character data
Adds the passed nodes before the character data.
void
after(Node|string ...$nodes)
Adds nodes after the character data
Adds the passed nodes after the character data.
void
replaceWith(Node|string ...$nodes)
Replaces the character data with new nodes