Difference between revisions of "Extensions.Xml.DeleteXmlChildElement"
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
Xml.XmlElement XmlElement1; | Xml.XmlElement XmlElement1; | ||
Xml.XmlElement XmlElement2; | Xml.XmlElement XmlElement2; |
Revision as of 10:17, 25 October 2018
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, XmlElementTerm);
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