Extensions.Xml.DeleteXmlChildElement

From emotive
Jump to navigation Jump to search

Classification

Name DeleteXmlChildElement
Short Description Deletes the connection of the given element from its parent
Class Action
Extension OTX Xml extension
Group Xml related Actions
Exceptions XmlChangeException
Checker Rules -
Standard Compliant Yes

OTL Syntax

Xml.DeleteXmlChildElement(XmlElementTerm parent, XmlElementTerm child);

Description

The DeleteXmlChildElement action is used to delete the connection of the given element from its parent. If the given child element is not a child of the given parent, the XmlException shall be thrown and no deletion shall take place. After deleting the connection, the child element can be reused in the same way as a new element.

Properties

Name Data Type Class Default Cardinality Description
Child XmlElement Term - [1..1] The element which should be deleted.
Parent XmlElement Term - [1..1] The element which contains the element to be deleted.

OTL Examples

/// Local Declarations

Xml.XmlElement XmlElement1;
Xml.XmlElement XmlElement2;

/// Flow

XmlElement1 = Xml.CreateXmlElement("root", "xyz");
XmlElement2 = Xml.CreateXmlElement("child");
Xml.AddXmlChildElement(XmlElement1, XmlElement2);
Xml.DeleteXmlChildElement(XmlElement1, XmlElement2);

See also

AddXmlChildElement
DeleteXmlAttribute
SetXmlComment
SetXmlElementAttribute
SetXmlElementAttributes
SetXmlElementText
SetXmlProcessingInstructions
ValidateXml
XmlSaveToFile