You are here

public function XpathDomXpath::query in Feeds extensible parsers 8

Evaluates the given XPath expression.

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::query()

File

src/XpathDomXpath.php, line 75

Class

XpathDomXpath
Wraps DOMXPath simplifying usage.

Namespace

Drupal\feeds_ex

Code

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