You are here

protected function Xml::executeRowQuery in Views XML Backend 8

Executes an XPath query on a given row.

Parameters

\DOMXPath $xpath: The XPath object.

string $selector: The XPath selector.

\DOMNode $row: The row as.

Return value

string[] Returns a list of values from the row.

1 call to Xml::executeRowQuery()
Xml::doExecute in src/Plugin/views/query/Xml.php
Performs the actual view execution.

File

src/Plugin/views/query/Xml.php, line 755
Contains \Drupal\views_xml_backend\Plugin\views\query\Xml.

Class

Xml
Views query plugin for an XML query.

Namespace

Drupal\views_xml_backend\Plugin\views\query

Code

protected function executeRowQuery(\DOMXPath $xpath, $selector, \DOMNode $row) {
  $node_list = $xpath
    ->query($selector, $row);
  if ($node_list === FALSE) {
    return [];
  }
  $values = [];
  foreach ($node_list as $node) {
    $values[] = $node->nodeValue;
  }
  return $values;
}