Removes an XML child element.
public bool RemoveChild(string name);
public bool RemoveChild(string name, int index);
Parameter | Description |
---|---|
name | Specifies the name of the sub-element to remove. |
index | Specifies the number of the sub-element beginning with 1. If this value does not match any existing sub-element, an error occurs. |
The return value is false, if the element could not be removed because the document becomes invalid according to the document's DTD. In this case, an Xml
The following example removes the second Telephone element of the second address in an XML document that contains addresses consisting of the sub-elements Name, Street, City and Telephone.
textControl1.GetXmlElements("Adress").GetItem(2).RemoveChild("Telephone", 2);