You are here

public function RendererBase::extractXPathInnerHTML in Forena Reports 8

Extracts the inner html of all nodes that match a particular xpath expression.

Parameters

$query string xpath query expression:

DOMNode $context Dom node to use as source:

$concat boolean Set to false to return an array with the source for each element matching the path.:

Return value

String XHTML source

File

src/FrxPlugin/Renderer/RendererBase.php, line 1008
FrxRenderer.php Base class for FrxAPI custom Renderer @author davidmetzler

Class

RendererBase
Crosstab Renderer

Namespace

Drupal\forena\FrxPlugin\Renderer

Code

public function extractXPathInnerHTML($query, DOMNode $context, $concat = TRUE) {
  $result = $this->xpathQuery
    ->query($query, $context);
  $length = $result->length;
  $content = array();
  for ($i = 0; $i < $length; $i++) {
    $content[] = $this
      ->extractChildSource($result
      ->item($i));
  }
  if ($concat) {
    $content = implode('', $content);
  }
  return $content;
}