You are here

public function FrxXML::render in Forena Reports 7.4

Same name and namespace in other branches
  1. 7.3 renderers/FrxXML.inc \FrxXML::render()

Default Render action, which simply does normal forena rendering. You can use renderDomNode at any time to generate the default forena rendering methods.

Return value

Ambigous <string, unknown, unknown_type, text, mixed>

Overrides FrxRenderer::render

File

renderers/FrxXML.inc, line 9
FrxXML Just render the XML source data. Look at the FrxRender class to see a full list of properties that can be used here.

Class

FrxXML
@file FrxXML Just render the XML source data. Look at the FrxRender class to see a full list of properties that can be used here.

Code

public function render() {
  $output = '';
  $node = $this->reportDocNode;
  $options = $this
    ->mergedAttributes();
  if (isset($options['context'])) {
    $xml = Frx::Data()
      ->getContext($options['context']);
  }
  else {
    $xml = FrxData::instance()
      ->currentContext();
  }
  if (is_array($xml)) {
    $xml = FrxData::arrayToXml($xml);
  }
  if ($xml && is_callable(array(
    $xml,
    'asXML',
  ))) {
    $dom = dom_import_simplexml($xml);
    $dom->ownerDocument->formatOutput = TRUE;
    $dom->ownerDocument->preserveWhiteSpace = TRUE;
    $output = $dom->ownerDocument
      ->saveXML($dom->ownerDocument->documentElement);
  }
  if ($this->format != 'xml') {
    $output = '<pre>' . htmlspecialchars($output) . '</pre>';
  }
  return $output;
}