You are here

public function FrxRenderer::extractXPathInnerHTML in Forena Reports 7.4

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

4 calls to FrxRenderer::extractXPathInnerHTML()
FrxCrosstab::scrapeConfig in renderers/FrxCrosstab.inc
Extract table configuration from the HTML
FrxEmailMerge::scrapeConfig in renderers/FrxEmailMerge.inc
Default method for extracting configuration information from the template. This just scrapes teh current child html as the template.
FrxFieldTable::scrapeConfig in renderers/FrxFieldTable.inc
Extract table configuration from the HTML
FrxTable::scrapeConfig in renderers/FrxTable.inc
Extract table configuration from the HTML

File

renderers/FrxRenderer.inc, line 983
FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

Class

FrxRenderer
@file FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

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