public function Report::deleteNode in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/Report.php \Drupal\forena\Report::deleteNode()
Delete a node based on id
Parameters
unknown_type $id:
Return value
unknown_type
File
- src/
Report.php, line 455 - Basic report provider. Controls the rendering of the report.
Class
Namespace
Drupal\forenaCode
public function deleteNode($id) {
$path = 'body//*[@id="' . $id . '"]';
$nodes = $this->rpt_xml
->xpath($path);
if ($nodes) {
$node = $nodes[0];
$dom = dom_import_simplexml($node);
$dom->parentNode
->removeChild($dom);
}
}