The DOMXPath class
(PHP 5, PHP 7, PHP 8)
Introduction
Allows to use XPath 1.0 queries on HTML or XML documents.
Class synopsis
Properties
- document
- The document that is linked to this object.
- registerNodeNamespaces
- When set to
true, namespaces in the node are registered.
Changelog
| Version | Description |
|---|---|
| 8.4.0 | It is no longer possible to clone a DOMXPath object. Doing so will result in an exception being thrown. Prior to PHP 8.4.0 this resulted in an unusable object. |
| 8.0.0 | The registerNodeNamespaces property has been added. |
Table of Contents
- DOMXPath::__construct — Creates a new DOMXPath object
- DOMXPath::evaluate — Evaluates the given XPath expression and returns a typed result if possible
- DOMXPath::query — Evaluates the given XPath expression
- DOMXPath::quote — Quotes a string for use in an XPath expression
- DOMXPath::registerNamespace — Registers the namespace with the DOMXPath object
- DOMXPath::registerPhpFunctionNS — Register a PHP functions as namespaced XPath function
- DOMXPath::registerPhpFunctions — Register PHP functions as XPath functions
↑ and ↓ to navigate • Enter to select • Esc to close • / to open