Remove an element or a list of elements from their parents
xmlRemove(elems)
:
Detach one or several elements from their parents. The detached elements are definitly lost.
doc = `xmlReadStr`_("<root><a>Hello</a><b>Scilab</b><a>World</a></root>");
// Remove all the <a>
xp = `xmlXPath`_(doc, "//a");
xmlRemove(xp);
`xmlDump`_(doc)
xmlDelete(doc);
// Remove the first element
doc = `xmlReadStr`_("<root><a>Hello</a><b>Scilab</b><a>World</a></root>");
xmlRemove(doc.root.children(1));
`xmlDump`_(doc)
//Remove all the root children
xmlRemove(doc.root.children);
`xmlDump`_(doc)
xmlDelete(doc);
Version Description 5.4.0 XML module introduced. .. _XMLObjects: XMLObjects.html