Removes specified child from the node \param where Pointer to child to be removed.
| 1182 | //! Removes specified child from the node |
| 1183 | // \param where Pointer to child to be removed. |
| 1184 | void remove_node(xml_node<Ch> *where) |
| 1185 | { |
| 1186 | assert(where && where->parent() == this); |
| 1187 | assert(first_node()); |
| 1188 | if (where == m_first_node) |
| 1189 | remove_first_node(); |
| 1190 | else if (where == m_last_node) |
| 1191 | remove_last_node(); |
| 1192 | else |
| 1193 | { |
| 1194 | where->m_prev_sibling->m_next_sibling = where->m_next_sibling; |
| 1195 | where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; |
| 1196 | where->m_parent = 0; |
| 1197 | } |
| 1198 | } |
| 1199 | |
| 1200 | //! Removes all child nodes (but not attributes). |
| 1201 | void remove_all_nodes() |