DOMElement sınıfı

(PHP 5, PHP 7, PHP 8)

Sınıf Sözdizimi

class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode {
/* Özellikler */
public readonly string $tagName;
public readonly mixed $schemaTypeInfo = null;
public readonly ?DOMElement $firstElementChild;
public readonly ?DOMElement $lastElementChild;
public readonly int $childElementCount;
/* Miras alınan özellikler */
public readonly ?string $nodeName;
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;
/* Yöntemler */
public __construct(string $qualifiedName, ?string $value = null, string $namespace = "")
public after(DOMNode|string ...$nodes): void
public append(DOMNode|string ...$nodes): void
public before(DOMNode|string ...$nodes): void
public getAttributeNS(?string $uri, string $isim): string
public getElementsByTagNameNS(?string $isimalanı, string $isim): DOMNodeList
public hasAttribute(string $isim): bool
public hasAttributeNS(?string $uri, string $isim): bool
public insertAdjacentText(string $where, string $data): void
public prepend(DOMNode|string ...$nodes): void
public remove(): void
public removeAttribute(string $isim): bool
public removeAttributeNS(?string $uri, string $isim): void
public replaceChildren(DOMNode|string ...$nodes): void
public replaceWith(DOMNode|string ...$nodes): void
public setAttribute(string $isim, string $değer): DOMAttr|bool
public setAttributeNS(?string $uri, string $isim, string $değer): void
public setIdAttribute(string $isim, bool $id_olarak): void
public setIdAttributeNode(DOMAttr $öznitelik, bool $id_olarak): void
public setIdAttributeNS(string $uri, string $isim, bool $id_olarak): void
public toggleAttribute(string $qualifiedName, ?bool $force = null): bool
/* Miras alınan yöntemler */
public DOMNode::C14N(
    bool $özel = false,
    bool $aAçıklamalı = false,
    ?array $xpath = null,
    ?array $isim_alanları = null
): string|false
public DOMNode::C14NFile(
    string $uri,
    bool $exclusive = false,
    bool $withComments = false,
    ?array $xpath = null,
    ?array $nsPrefixes = null
): int|false
public DOMNode::cloneNode(bool $torunlar_dahil = false): DOMNode|false
public DOMNode::isEqualNode(?DOMNode $otherNode): bool
public DOMNode::isSameNode(DOMNode $düğüm): bool
public DOMNode::isSupported(string $özellik, string $sürüm): bool
}

Özellikler

childElementCount

Çocuk eleman sayısı.

firstElementChild

İlk çocuk eleman ya da null.

lastElementChild

Son çocuk eleman ya da null.

nextElementSibling

Sonraki kardeş eleman ya da null.

previousElementSibling

Önceki kardeş eleman ya da null.

schemaTypeInfo

Henüz gerçeklenmedi; daima null döndürür.

tagName

Elemanın ismi

Sürüm Bilgisi

Sürüm: Açıklama
8.0.0 firstElementChild, lastElementChild, childElementCount, previousElementSibling, ve nextElementSibling özellikleri eklendi.
8.0.0 DOMElement artık DOMParentNode ve DOMChildNode arayüzünü gerçekliyor.

Notlar

Bilginize:

DOM eklentisi UTF-8 kodlama kullanır. Diğer kodlamalarla çalışmak için mb_convert_encoding(), UConverter::transcode() veya iconv() kullanılabilir.

İçindekiler