You are here

public function FeedsExXpathDomXpath::evaluate in Feeds extensible parsers 7.2

Same name and namespace in other branches
  1. 7 src/FeedsExXml.inc \FeedsExXpathDomXpath::evaluate()

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

DOMXPath::evaluate()

File

src/FeedsExXml.inc, line 385
Contains FeedsExXml.

Class

FeedsExXpathDomXpath
Wraps DOMXPath simplifying usage.

Code

public function evaluate($expression, DOMNode $context_node = NULL) {
  if ($context_node === NULL) {
    $context_node = $this->xpath->document;
  }
  return $this->xpath
    ->evaluate($expression, $context_node);
}