You are here

public function FeedsExXpathDomXpath::query in Feeds extensible parsers 7

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

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/FeedsExXml.inc, line 429
Contains FeedsExXml.

Class

FeedsExXpathDomXpath
Wraps DOMXPath simplifying usage.

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);
}