Scilab Website | Contribute with GitLab | Scilab Community | ATOMS toolboxes
Scilab Online Help
2026.1.0 - English


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

VersionDescription
5.4.0 XML module introduced.
Report an issue
<< xmlRelaxNG XML Management xmlSchema >>

Copyright (c) 2022-2026 (Dassault Systèmes S.E.)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue May 19 13:56:06 CEST 2026