class XML in Forena Reports 8
XML Document
Provide the report content as XML. Only contents of the body will be imported.
Plugin annotation
@FrxDocument(
  id= "xml",
  name="XML Document",
  ext="xml"
)
  Hierarchy
- class \Drupal\forena\FrxPlugin\Document\DocumentBase implements DocumentInterface uses FrxAPI
 
Expanded class hierarchy of XML
1 file declares its use of XML
- FrxSection.php in src/
FrxPlugin/ Template/ FrxSection.php  
File
- src/
FrxPlugin/ Document/ XML.php, line 23  - HTML Straight XML document with no wrapping theme. @author davidmetzler
 
Namespace
Drupal\forena\FrxPlugin\DocumentView source
class XML extends DocumentBase {
  use FrxAPI;
  public $root_tag = 'div';
  public $root_attributes = array();
  public function __construct() {
    $this->allowDirectOutput = FALSE;
    $this->content_type = 'application/xml';
    $skin = $this
      ->getDataContext('skin');
    if (isset($skin['XML']['rootElementName'])) {
      $this->root_tag = $skin['XML']['rootElementName'];
      if ($this->root_tag == 'none') {
        $this->root_tag = '';
      }
    }
    if (isset($skin['XML']['rootElementAttributes'])) {
      if (is_array($skin['XML']['rootElementAttributes'])) {
        $this->root_attributes = $skin['XML']['rootElementAttributes'];
      }
    }
  }
  public function header() {
    parent::header();
    $text = '<?xml version="1.0"?>' . "\n";
    $this
      ->write($text);
    $opening_tag = $this
      ->_build_opening_root_tag_contents();
    if ($this->root_tag) {
      $opening_tag = "<{$opening_tag}>\n";
      $this
        ->write($opening_tag);
    }
  }
  public function footer() {
    if ($this->root_tag) {
      $ending_tag = $this->root_tag;
      $ending_tag = "</{$ending_tag}>";
      $this
        ->write($ending_tag);
    }
  }
  private function _build_opening_root_tag_contents() {
    $tag_contents = $this->root_tag;
    if (isset($this->root_attributes) && is_array($this->root_attributes)) {
      foreach ($this->root_attributes as $attr_key => $attr_val) {
        if (!empty($attr_key) && (string) $attr_val !== '') {
          $attr_val = addslashes($attr_val);
          $tag_contents .= " " . $attr_key . "=" . "'{$attr_val}'";
        }
      }
    }
    return $tag_contents;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  protected | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  protected | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  protected | property | ||
| 
            DocumentBase:: | 
                  protected | property | ||
| 
            DocumentBase:: | 
                  public | property | ||
| 
            DocumentBase:: | 
                  protected | property | ||
| 
            DocumentBase:: | 
                  public | function | ||
| 
            DocumentBase:: | 
                  public | function | Wrapper function for check output to default the right type. | |
| 
            DocumentBase:: | 
                  public | function | 
            Clear the buffer Overrides DocumentInterface:: | 
                  |
| 
            DocumentBase:: | 
                  public | function | Perform character set conversion | |
| 
            DocumentBase:: | 
                  public | function | 
            Write the output to disk. Overrides DocumentInterface:: | 
                  9 | 
| 
            DocumentBase:: | 
                  public | function | ||
| 
            DocumentBase:: | 
                  public | function | 
            Overrides DocumentInterface:: | 
                  |
| 
            DocumentBase:: | 
                  public | function | 
            Overrides DocumentInterface:: | 
                  |
| 
            DocumentBase:: | 
                  public | function | 
            Write Overrides DocumentInterface:: | 
                  |
| 
            FrxAPI:: | 
                  public | function | Returns containing application service | |
| 
            FrxAPI:: | 
                  public | function | Get the current data context. | |
| 
            FrxAPI:: | 
                  public | function | ||
| 
            FrxAPI:: | 
                  public | function | Returns the data manager service | |
| 
            FrxAPI:: | 
                  public | function | Return Data Service | |
| 
            FrxAPI:: | 
                  public | function | Returns the fornea document manager | |
| 
            FrxAPI:: | 
                  public | function | Report an error | |
| 
            FrxAPI:: | 
                  public | function | Get the context of a specific id. | |
| 
            FrxAPI:: | 
                  public | function | Get the current document | |
| 
            FrxAPI:: | 
                  public | function | Load the contents of a file in the report file system. | |
| 
            FrxAPI:: | 
                  function | Enter description here... | 1 | |
| 
            FrxAPI:: | 
                  public | function | Pop data off of the stack. | |
| 
            FrxAPI:: | 
                  public | function | Push data onto the Stack | |
| 
            FrxAPI:: | 
                  public | function | Run a report with a particular format. | 1 | 
| 
            FrxAPI:: | 
                  public | function | Get the current report file system. | |
| 
            FrxAPI:: | 
                  public | function | Set Data context by id. | |
| 
            FrxAPI:: | 
                  public | function | Change to a specific document type. | |
| 
            FrxAPI:: | 
                  public | function | Get list of skins. | |
| 
            XML:: | 
                  public | property | ||
| 
            XML:: | 
                  public | property | ||
| 
            XML:: | 
                  public | function | 
            No default footer. Overrides DocumentBase:: | 
                  |
| 
            XML:: | 
                  public | function | 
            Default implementation to put in content type based headers. Overrides DocumentBase:: | 
                  |
| 
            XML:: | 
                  private | function | ||
| 
            XML:: | 
                  public | function |