Die Klasse DOMElement

(PHP 5, PHP 7, PHP 8)

Klassenbeschreibung

classDOMElementextendsDOMNodeimplementsDOMParentNode, DOMChildNode {
publicreadonlystring$tagName;
publicstring$id;
publicreadonlymixed$schemaTypeInfo = null;
publicreadonlyint$childElementCount;
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$qualifiedName, ?string$value = null, string$namespace = "")
publicafter(DOMNode|string...$nodes): void
publicappend(DOMNode|string...$nodes): void
publicbefore(DOMNode|string...$nodes): void
publicgetAttribute(string$qualifiedName): string
publicgetAttributeNS(?string$namespace, string$localName): string
publicgetElementsByTagNameNS(?string$namespace, string$localName): DOMNodeList
publichasAttribute(string$qualifiedName): bool
publichasAttributeNS(?string$namespace, string$localName): bool
publicinsertAdjacentText(string$where, string$data): void
publicprepend(DOMNode|string...$nodes): void
publicremove(): void
publicremoveAttribute(string$qualifiedName): bool
publicremoveAttributeNS(?string$namespace, string$localName): void
publicreplaceWith(DOMNode|string...$nodes): void
publicsetAttribute(string$qualifiedName, string$value): DOMAttr|bool
publicsetAttributeNS(?string$namespace, string$qualifiedName, string$value): void
publicsetIdAttribute(string$qualifiedName, bool$isId): void
publicsetIdAttributeNode(DOMAttr$attr, bool$isId): void
publicsetIdAttributeNS(string$namespace, string$qualifiedName, bool$isId): void
publictoggleAttribute(string$qualifiedName, ?bool$force = null): 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
}

Eigenschaften

childElementCount

Die Anzahl der Kindelemente.

firstElementChild

Erstes Kindelement oder null.

lastElementChild

Letztes Kindelement oder null.

nextElementSibling

Das nächste Geschwisterelement oder null.

previousElementSibling

Das vorherige Geschwisterelement oder null.

schemaTypeInfo

Noch nicht implementiert, gibt immer null zurück

tagName

Der Name des Elements

className

Eine Zeichenkette, die die Klassen des Elements durch Leerzeichen getrennt darstellt

id

Die ID des Elements

Changelog

VersionBeschreibung
8.0.0 Die Eigenschaften firstElementChild, lastElementChild, childElementCount, previousElementSibling, und nextElementSibling wurden hinzugefügt.
8.0.0DOMElement implementiert nun DOMParentNode und DOMChildNode.

Anmerkungen

Hinweis:

Die Erweiterung DOM verwendet die UTF-8 Kodierung. Es kann mb_convert_encoding(), UConverter::transcode() oder iconv() verwendet werden, um mit anderen Zeichenkodierungen zu arbeiten.

Inhaltsverzeichnis

To Top