XPath
final class XPath (View source)
Allows to use XPath 1.0 queries on HTML or XML documents.
This is the modern, spec-compliant equivalent of DOMXPath.
Properties
| Document | $document | ||
| bool | $registerNodeNamespaces |
Methods
null|bool|float|string|NodeList
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
null|bool|float|string|NodeList
evaluate(string $expression, Node|null $contextNode = null, bool $registerNodeNS = true)
No description
NodeList
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