public function ReportEditor::deleteNode in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/Editor/ReportEditor.php \Drupal\forena\Editor\ReportEditor::deleteNode()
Delete a node based on id
Parameters
unknown_type $id:
Return value
unknown_type
File
- src/
Editor/ ReportEditor.php, line 793 - ReportEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd
Class
Namespace
Drupal\forena\EditorCode
public function deleteNode($id) {
$path = 'body//*[@id="' . $id . '"]';
$dom = $this->dom;
$nodes = $this->simplexml
->xpath($path);
if ($nodes) {
$node = $nodes[0];
$dom = dom_import_simplexml($node);
$dom->parentNode
->removeChild($dom);
}
return $this;
}