DOMXPath
class DOMXPath (View source)
The DOMXPath class (supports XPath 1.0)
Properties
DOMDocument | $document | ||
$registerNodeNamespaces |
Methods
bool
registerNamespace(string $prefix, string $namespace)
Registers the namespace with the
mixed
mixed
void
registerPhpFunctions(string|string[] $restrict = null)
Register PHP functions as XPath functions
void
registerPhpFunctionNS(string $namespaceURI, string $name, callable $callable)
No description
static string
quote(string $str)
No description
Details
__construct(DOMDocument $document, bool $registerNodeNS = true)
Creates a new
bool
registerNamespace(string $prefix, string $namespace)
Registers the namespace with the
mixed
query(string $expression, DOMNode $contextNode = null, bool $registerNodeNS = true)
Evaluates the given XPath expression
mixed
evaluate(string $expression, DOMNode $contextNode = null, bool $registerNodeNS = true)
Evaluates the given XPath expression and returns a typed result if possible.
void
registerPhpFunctions(string|string[] $restrict = null)
Register PHP functions as XPath functions
void
registerPhpFunctionNS(string $namespaceURI, string $name, callable $callable)
Since: 8.4
No description
static string
quote(string $str)
Since: 8.4
No description