You are here

public function FrxRenderer::removeChildrenExcept in Forena Reports 7.4

Removes all chidren from the dome node expect those with a tagname specified by the the $tags argurment

Parameters

$node Parent node to remove from:

$tags array Tags to eingore:

File

renderers/FrxRenderer.inc, line 890
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 removeChildrenExcept(DOMNode $node, $tags = array(
  'table',
)) {
  foreach ($node->childNodes as $child) {
    if ($child->nodeType != XML_ELEMENT_NODE || array_search($child->tagName, $tags) === FALSE) {
      $this
        ->removeChildren($child);
      $node
        ->removeChild($child);
    }
  }
}