xmlRemove
Remove an element or a list of elements from their parents
Syntax
xmlRemove(elems)
Arguments
- elems
elems, a XMLElem or a XMLSet (result of XPath query) or a XMLlist (a children list)
Description
Detach one or several elements from their parents. The detached elements are definitely lost.
Examples
xdoc = xmlReadStr("<root><a>Hello</a><b>Scilab</b><a>World</a></root>"); // Remove all the <a> xp = xmlXPath(xdoc, "//a"); xmlRemove(xp); xmlDump(xdoc) xmlDelete(xdoc); // Remove the first element xdoc = xmlReadStr("<root><a>Hello</a><b>Scilab</b><a>World</a></root>"); xmlRemove(xdoc.root.children(1)); xmlDump(xdoc) //Remove all the root children xmlRemove(xdoc.root.children); xmlDump(xdoc) xmlDelete(xdoc);
See also
- XMLObjects — Describe the properties of the different XML objects
History
| Версия | Описание |
| 5.4.0 | XML module introduced. |
| Report an issue | ||
| << xmlRelaxNG | XML Management | xmlSchema >> |