RemoveAllChildNode method: XmlNode class

Syntax

RemoveAllChildNode()

Description

Use the RemoveAllChildNode method to remove all child nodes for an XmlNode.

Parameters

None.

Returns

None.

Example

For example:

Local XmlDoc &inXMLDoc;
Local XmlNode &elementNode;

&inXMLDoc = CreateXmlDoc("<?xml version='1.0'?><root/>");
&elementNode = &inXMLDoc.DocumentElement.AddElement("first");
&elementNode = &inXMLDoc.DocumentElement.AddElement("second");
&elementNode = &inXMLDoc.DocumentElement.AddElement("third");

&inXMLDoc.DocumentElement.RemoveAllChildNode();

This is the XML document before the removal:

<?xml version="1.0"?>
<root>
  <first/>
  <second/>
  <third/>
</root>

This is the XML document after the removal:

<?xml version="1.0"?>
<root/>