DOMText クラス

(PHP 5, PHP 7, PHP 8)

はじめに

DOMText クラスは DOMCharacterData を継承しており、 DOMElement あるいは DOMAttr の中身のテキストを表します。

クラス概要

classDOMTextextendsDOMCharacterData {
publicreadonlystring$wholeText;
publicreadonlyint$length;
publicreadonlystring$nodeName;
publicreadonlyint$nodeType;
publicreadonly?DOMNode$parentNode;
publicreadonly?DOMElement$parentElement;
publicreadonlyDOMNodeList$childNodes;
publicreadonly?DOMNode$firstChild;
publicreadonly?DOMNode$lastChild;
publicreadonly?DOMNode$previousSibling;
publicreadonly?DOMNode$nextSibling;
publicreadonlybool$isConnected;
publicreadonly?string$namespaceURI;
publicreadonly?string$localName;
publicreadonly?string$baseURI;
public__construct(string$data = "")
publicsplitText(int$offset): DOMText|false
publicDOMCharacterData::replaceData(int$offset, int$count, string$data): bool
publicDOMNode::C14N(
    bool$exclusive = false,
    bool$withComments = false,
    ?array$xpath = null,
    ?array$nsPrefixes = null
): string|false
publicDOMNode::C14NFile(
    string$uri,
    bool$exclusive = false,
    bool$withComments = false,
    ?array$xpath = null,
    ?array$nsPrefixes = null
): int|false
publicDOMNode::isSameNode(DOMNode$otherNode): bool
publicDOMNode::isSupported(string$feature, string$version): bool
}

プロパティ

wholeText

論理的に隣接した (要素やコメント、処理命令などで分割されていない) テキストノードの全テキストを保持します。

変更履歴

バージョン説明
8.0.0 実装されていなかったメソッド DOMText::replaceWholeText() が削除されました。

目次

To Top