43 $a_content, $a_attributes, $a_remove_childs =
true)
45 $search = $a_successors;
46 $search[] = $a_node_name;
48 $childs = $parent_node->child_nodes();
49 $cnt_childs = count($childs);
52 foreach($childs as $child)
54 $child_name = $child->node_name();
56 if (in_array($child_name, $search))
66 $new_node =& $doc->create_element($a_node_name);
67 $new_node =& $parent_node->append_child($new_node);
70 $new_node->set_content($a_content);
76 if ($child_name == $a_node_name)
80 $childs2 = $child->child_nodes();
81 for($i=0; $i<count($childs2); $i++)
83 $child->remove_child($childs2[$i]);
88 $child->set_content($a_content);
94 $new_node =& $doc->create_element($a_node_name);
95 $new_node =& $child->insert_before($new_node, $child);
98 $new_node->set_content($a_content);
113 foreach ($a_attributes as $attribute => $value)
117 $a_node->set_attribute($attribute, $value);
121 if ($a_node->has_attribute($attibute))
123 $a_node->remove_attribute($attribute);
134 $childs = $a_parent->child_nodes();
135 foreach($childs as $child)
137 $child_name = $child->node_name();
138 if (in_array($child_name, $a_node_names))
140 $child->unlink_node();
151 $a_content, $a_attributes)
153 $search = $a_successors;
155 $childs = $parent_node->child_nodes();
156 $cnt_childs = count($childs);
158 foreach($childs as $child)
160 $child_name = $child->node_name();
161 if (in_array($child_name, $search))
170 $new_node = $doc->create_element($a_node_name);
171 $new_node = $parent_node->append_child($new_node);
172 if ($a_content !=
"")
174 $new_node->set_content($a_content);
180 $new_node = $doc->create_element($a_node_name);
181 $new_node = $child->insert_before($new_node, $child);
182 if ($a_content !=
"")
184 $new_node->set_content($a_content);