You are here

protected function DOMXPath::debug in Feeds XPath Parser 8

Renders our debug messages into a list.

@todo Use theme_item_list().

Parameters

mixed $data: The result of an XPath query. Either a scalar or a DOMNodeList.

string $source: The source key that produced this query.

Overrides DOMXPath::debug

1 call to DOMXPath::debug()
DOMXPath::namespacedQuery in lib/Drupal/feeds_xpathparser/DOMXPath.php
Executes an XPath query with namespace support.
1 method overrides DOMXPath::debug()
DOMXPath::debug in lib/Drupal/feeds_xpathparser/DOMXPath.php
Renders our debug messages into a list.

File

lib/Drupal/feeds_xpathparser/DOMXPath.php, line 89
Contains \Druapl\feeds_xpathparser\DOMXPath.

Class

DOMXPath
Wraps DOMXPath providing enhanced debugging and special namespace handling.

Namespace

Drupal\feeds_xpathparser

Code

protected function debug($data, $source) {
  $output = "{$source} : <ul>";
  if ($data instanceof \DOMNodeList) {
    foreach ($data as $node) {
      $output .= '<li>' . check_plain($this->doc
        ->saveXML($node)) . '</li>';
    }
  }
  else {
    $output .= '<li>' . check_plain($data) . '</li>';
  }
  $output .= '</ul>';
  drupal_set_message($output);
}