public function XpathDomXpath::evaluate in Feeds extensible parsers 8
Evaluates the XPath expression and returns a typed result if possible.
Parameters
string $expression: The XPath expression to execute.
\DOMNode $context_node: (optional) The optional contextnode can be specified for doing relative XPath queries. Defaults to the root element.
See also
File
- src/
XpathDomXpath.php, line 57
Class
- XpathDomXpath
- Wraps DOMXPath simplifying usage.
Namespace
Drupal\feeds_exCode
public function evaluate($expression, DOMNode $context_node = NULL) {
if ($context_node === NULL) {
$context_node = $this->xpath->document;
}
return $this->xpath
->evaluate($expression, $context_node);
}