The DOMXPath class

The DOMXPath class

(PHP 5, PHP 7, PHP 8)

簡介

Supports XPath 1.0

類摘要

class DOMXPath {
/* 屬性 */
public readonly DOMDocument $document;
/* 方法 */
public __construct(DOMDocument $document, bool $registerNodeNS = true)
public evaluate(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed
public query(string $expression, ?DOMNode $contextNode = null, bool $registerNodeNS = true): mixed
public registerNamespace(string $prefix, string $namespace): bool
public registerPhpFunctions(string|array|null $restrict = null): void
}

屬性

document

registerNodeNamespaces

When set to true, namespaces in the node are registered.

更新日誌

版本 說明
8.0.0 The registerNodeNamespaces property has been added.

目錄

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *