The DOMXPath class
(PHP 5, PHP 7, PHP 8)
简介
Allows to use XPath 1.0 queries on HTML or XML documents.
类摘要
属性
- document
- The document that is linked to this object.
- registerNodeNamespaces
-
When set to
true, namespaces in the node are registered.
更新日志
| 版本 | 说明 |
|---|---|
| 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. |
目录
- 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