Difference between revisions of "Extensions.Xml.DeleteXmlChildElement"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | Xml.DeleteXmlChildElement(XmlElementTerm, XmlElementTerm); | + | Xml.DeleteXmlChildElement(XmlElementTerm parent, XmlElementTerm child); |
</syntaxhighlight> | </syntaxhighlight> | ||
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; |
Latest revision as of 04:57, 8 November 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 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