You are here

public function FrxFiles::data in Forena Reports 7

Same name and namespace in other branches
  1. 6.2 plugins/FrxFiles.inc \FrxFiles::data()
  2. 6 plugins/FrxFiles.inc \FrxFiles::data()
  3. 7.2 plugins/FrxFiles.inc \FrxFiles::data()

File

plugins/FrxFiles.inc, line 27
File class for loading raw xml files as Sample data This class is used as a reference implementation of a data engine, but is also used to provide sample data files and reports. @author metzlerd

Class

FrxFiles
@file File class for loading raw xml files as Sample data This class is used as a reference implementation of a data engine, but is also used to provide sample data files and reports. @author metzlerd

Code

public function data($block_name, $parm_data = '', $subQuery = '') {
  $block = $this
    ->load_block($block_name);
  $xml = '';
  if (isset($block['source']) && $this
    ->access($block['access'])) {
    try {
      $xmlData = $block['source'];
      $xml = new SimpleXMLElement($xmlData);
    } catch (Exception $e) {
      forena_error("Error processing xml\n", $e
        ->getMessage() . "\n" . $xmlData);
    }
  }

  //@TODO: Implment xpath subquery parameter

  // Should filter returned nodes, but within the original root element?
  return $xml;
}