Since: 8.4

final class XPath (View source)

Properties

Document $document
bool $registerNodeNamespaces

Methods

__construct(Document $document, bool $registerNodeNS = true)

No description

NodeList
evaluate(string $expression, Node|null $contextNode = null, bool $registerNodeNS = true)

No description

query(string $expression, Node|null $contextNode = null, bool $registerNodeNS = true)

No description

bool
registerNamespace(string $prefix, string $namespace)

No description

void
registerPhpFunctions(string|array|null $restrict = null)

No description

void
registerPhpFunctionNS(string $namespaceURI, string $name, callable $callable)

No description

static string
quote(string $str)

No description

Details

__construct(Document $document, bool $registerNodeNS = true)

No description

Parameters

Document $document
bool $registerNodeNS

NodeList evaluate(string $expression, Node|null $contextNode = null, bool $registerNodeNS = true)

No description

Parameters

string $expression
Node|null $contextNode
bool $registerNodeNS

Return Value

NodeList

NodeList query(string $expression, Node|null $contextNode = null, bool $registerNodeNS = true)

No description

Parameters

string $expression
Node|null $contextNode
bool $registerNodeNS

Return Value

NodeList

bool registerNamespace(string $prefix, string $namespace)

No description

Parameters

string $prefix
string $namespace

Return Value

bool

void registerPhpFunctions(string|array|null $restrict = null)

No description

Parameters

string|array|null $restrict

Return Value

void

void registerPhpFunctionNS(string $namespaceURI, string $name, callable $callable)

No description

Parameters

string $namespaceURI
string $name
callable $callable

Return Value

void

static string quote(string $str)

No description

Parameters

string $str

Return Value

string