Method XmlNode():removeChild() Foundation

Removes a child node by node name, ordinal or by object reference.

Syntax
:removeChild( <nOrdinal> ) --> self | NIL
:removeChild( <cName> ) --> self | NIL
:removeChild( <oChild> ) --> self | NIL
Parameters
<nOrdinal>
A numeric value with the ordinal position of the node in the child list.
<cName>
An character string with the name of the child node to be removed. The node name must be specified as a local name, that is, as the node name without a namespace qualifier.
<oChild>
The XmlNode() object representing the node object to be removed.
Return

The XmlNode() object that was removed from the child list. If the specified child node is not a child node, the ordinal position is out of range or if no child node could be found with the specified name, :removeChild() returns NIL.

Description

The method :removeChild() removes a specific child node which can be specified either by name, by ordinal position or by directly specifying the corresponding node object. Note that if a node name is specified in the <cName> parameter and there several child nodes exist with this name, only the first node is removed by :removeChild(). Use the method :removeChilds() for removing multiple child nodes.

The node name specified in <cName> is case-insensitive. This behavior is Xbase++-specific. Although it does not conform to the XML standard, the case-insensitive behavior is in line with how names and symbols are treated in the Xbase++ language.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.