The DOMNode class

(PHP 5, PHP 7, PHP 8)

Klassenbeschreibung

class DOMNode {
/* Eigenschaften */
public readonly string $nodeName;
public ?string $nodeValue;
public readonly int $nodeType;
public readonly ?DOMNode $parentNode;
public readonly DOMNodeList $childNodes;
public readonly ?DOMNode $firstChild;
public readonly ?DOMNode $lastChild;
public readonly ?DOMNode $previousSibling;
public readonly ?DOMNode $nextSibling;
public readonly ?DOMNamedNodeMap $attributes;
public readonly ?DOMDocument $ownerDocument;
public readonly ?string $namespaceURI;
public string $prefix;
public readonly ?string $localName;
public readonly ?string $baseURI;
public string $textContent;
/* Methoden */
public appendChild(DOMNode $node): DOMNode|false
public C14N(
    bool $exclusive = false,
    bool $withComments = false,
    ?array $xpath = null,
    ?array $nsPrefixes = null
): string|false
public C14NFile(
    string $uri,
    bool $exclusive = false,
    bool $withComments = false,
    ?array $xpath = null,
    ?array $nsPrefixes = null
): int|false
public cloneNode(bool $deep = false): DOMNode|false
public getLineNo(): int
public getNodePath(): ?string
public hasAttributes(): bool
public hasChildNodes(): bool
public insertBefore(DOMNode $node, ?DOMNode $child = null): DOMNode|false
public isDefaultNamespace(string $namespace): bool
public isSameNode(DOMNode $otherNode): bool
public isSupported(string $feature, string $version): bool
public lookupNamespaceUri(string $prefix): string
public lookupPrefix(string $namespace): ?string
public normalize(): void
public removeChild(DOMNode $child): DOMNode|false
public replaceChild(DOMNode $node, DOMNode $child): DOMNode|false
}

Eigenschaften

nodeName

Returns the most accurate name for the current node type

nodeValue

The value of this node, depending on its type. Contrary to the W3C specification, the node value of DOMElement nodes is equal to DOMNode::textContent instead of null.

nodeType

Gets the type of the node. One of the predefined XML_xxx_NODE constants

parentNode

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

childNodes

A DOMNodeList that contains all children of this node. If there are no children, this is an empty DOMNodeList.

firstChild

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

lastChild

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

previousSibling

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

nextSibling

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

attributes

A DOMNamedNodeMap containing the attributes of this node (if it is a DOMElement) or null otherwise.

ownerDocument

The DOMDocument object associated with this node, or null if this node is a DOMDocument

namespaceURI

The namespace URI of this node, or null if it is unspecified.

prefix

The namespace prefix of this node, or null if it is unspecified.

localName

Returns the local part of the qualified name of this node.

baseURI

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

textContent

The text content of this node and its descendants.

Changelog

Version Beschreibung
8.0.0 The unimplemented methods DOMNode::compareDocumentPosition(), DOMNode::isEqualNode(), DOMNode::getFeature(), DOMNode::setUserData() and DOMNode::getUserData() have been removed.

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

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Neuigkeiten für PHP-Entwickler: Laravel 11 Veröffentlichung

Am 12. März 2024 wurde die lang erwartete Version 11 des Laravel-Frameworks veröffentlicht, die eine Reihe von spannenden Neuerungen und Verbesserungen für die PHP-Entwicklungsgemeinschaft mit sich bringt. ...

Mike94

Autor : Mike94
Kategorie: PHP Magazin

Technisches SEO bleibt relevant

Technisches SEO – Was ist das überhaupt? Technisches SEO bezieht sich auf die Optimierung der technischen Aspekte deiner Webseite. Das Ziel ist klar! ...

admin

Autor : admin
Kategorie: SEO & Online-Marketing

Was ist neu in der PHP 8.2.10

PHP 8.2.10 ist eine der neuesten Versionen von PHP, die eine Reihe von Verbesserungen und neuen Funktionen mit sich bringt. In diesem Artikel werden wir einige der herausragenden Neuerungen und Verbesserungen dieser Version diskutieren. ...

admin

Autor : admin
Kategorie: Software-Updates

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Seltsames Verhalten von execute() oder Fehler meinerseits

Hallo liebe Community, ich habe ein kleines Problem und vielleicht kann mir ja jemand helfen, würde ich mich sehr drüber freuen. Unten steht e ...

Geschrieben von garibaldiwz am 22.03.2024 13:03:12
Forum: SQL / Datenbanken
Google reCAPTCHA in Kontaktformular einbinden

Überprüfen Sie den E-Mail-Versand: Stellen Sie sicher, dass die E-Mail-Funktion mail() ordnungsgemäß funktioniert und dass keine Fehler beim V ...

Geschrieben von Gast am 18.03.2024 04:54:16
Forum: PHP Developer Forum
`count.php`

Hallo cober93327, und Danke fuer deine Antwort! :-) Naja, so einen "Besucherzähler" auf der Webseite anzuzeigen ist schon eher etwas, das man a ...

Geschrieben von kekse1 am 17.03.2024 15:56:38
Forum: Projekthilfe
`count.php`

Es gibt dazu natuerlich auch eine recht ausfuehrliche Dokumentation in meinem GitHub-Repository Es würde meiner Ansicht nach enorm helfen, wenn D ...

Geschrieben von cober93327 am 14.03.2024 15:49:28
Forum: Projekthilfe