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
documentThe document that is linked to this object.
registerNodeNamespacesWhen 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
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
