Difference between revisions of "Extensions.Xml.AddXmlChildElement"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''AddXmlChildElement'''}}Category:Xml == Classification == {{ClassificationActivity | AddXmlChildElement | UPDATING... | Action | Extensions.Xml|...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:OTX '''AddXmlChildElement'''}}[[Category:Xml]] | {{DISPLAYTITLE:OTX '''AddXmlChildElement'''}}[[Category:Xml]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | AddXmlChildElement | | + | {{ClassificationActivity | AddXmlChildElement | Adds a child to a parent | [[Action]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Actions|Xml related Actions]] | [[Extensions.Xml.XmlChangeException|XmlChangeException]]| -|}} |
== OTL Syntax == | == OTL Syntax == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | Xml.AddXmlChildElement(XmlElementTerm parent, XmlElementTerm child, XmlElementTerm insertBefore); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== Description == | == Description == | ||
− | + | The '''AddXmlChildElement''' action is used to add a child to a parent. If this element has already been added to another parent or it is used as a root node, the [[Extensions.Xml.XmlException|'''XmlException''']] shall be thrown and the element is not added to the parent. | |
− | |||
− | |||
− | |||
− | |||
== Properties == | == Properties == | ||
− | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| | + | {{TableRowPropertie2| Child | [[Extensions.Xml.XmlElement|XmlElement]] | [[Term]] | - | [1..1] | The element that is added to the parent.}} |
+ | {{TableRowPropertie1| InsertBefore | [[Extensions.Xml.XmlElement|XmlElement]] | [[Term]] | - | [0..1] | Optional element. If omitted, the new child element is added at the last element of the parent otherwise before the element described here.}} | ||
+ | {{TableRowPropertie2| Parent | [[Extensions.Xml.XmlElement|XmlElement]]| [[Term]] | - | [1..1] | The element to which the child element is added.}} | ||
|} | |} | ||
− | |||
== 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 XmlElement2; | ||
− | // | + | /// Flow |
− | + | ||
− | + | XmlElement1 = Xml.CreateXmlElement("root", "text", {"attr":"val"}); | |
+ | XmlElement2 = Xml.CreateXmlElement("child", "childtext", {"attr1":"val1"}); | ||
+ | Xml.AddXmlChildElement(XmlElement1, XmlElement2); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== See also == | == See also == | ||
− | + | <!--[[Extensions.Xml.AddXmlChildElement|AddXmlChildElement]]<br/>--> | |
+ | [[Extensions.Xml.DeleteXmlAttribute|DeleteXmlAttribute]]<br/> | ||
+ | [[Extensions.Xml.DeleteXmlChildElement|DeleteXmlChildElement]]<br/> | ||
+ | [[Extensions.Xml.SetXmlComment|SetXmlComment]]<br/> | ||
+ | [[Extensions.Xml.SetXmlElementAttribute|SetXmlElementAttribute]]<br/> | ||
+ | [[Extensions.Xml.SetXmlElementAttributes|SetXmlElementAttributes]]<br/> | ||
+ | [[Extensions.Xml.SetXmlElementText|SetXmlElementText]]<br/> | ||
+ | [[Extensions.Xml.SetXmlProcessingInstructions|SetXmlProcessingInstructions]]<br/> | ||
+ | [[Extensions.Xml.ValidateXml|ValidateXml]]<br/> | ||
+ | [[Extensions.Xml.XmlSaveToFile|XmlSaveToFile]] |
Latest revision as of 04:54, 8 November 2018
Classification
Name | AddXmlChildElement |
Short Description | Adds a child to a parent |
Class | Action |
Extension | OTX Xml extension |
Group | Xml related Actions |
Exceptions | XmlChangeException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
Xml.AddXmlChildElement(XmlElementTerm parent, XmlElementTerm child, XmlElementTerm insertBefore);
Description
The AddXmlChildElement action is used to add a child to a parent. If this element has already been added to another parent or it is used as a root node, the XmlException shall be thrown and the element is not added to the parent.
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Child | XmlElement | Term | - | [1..1] | The element that is added to the parent. |
InsertBefore | XmlElement | Term | - | [0..1] | Optional element. If omitted, the new child element is added at the last element of the parent otherwise before the element described here. |
Parent | XmlElement | Term | - | [1..1] | The element to which the child element is added. |
OTL Examples
/// Local Declarations
Xml.XmlElement XmlElement1;
Xml.XmlElement XmlElement2;
/// Flow
XmlElement1 = Xml.CreateXmlElement("root", "text", {"attr":"val"});
XmlElement2 = Xml.CreateXmlElement("child", "childtext", {"attr1":"val1"});
Xml.AddXmlChildElement(XmlElement1, XmlElement2);
See also
DeleteXmlAttribute
DeleteXmlChildElement
SetXmlComment
SetXmlElementAttribute
SetXmlElementAttributes
SetXmlElementText
SetXmlProcessingInstructions
ValidateXml
XmlSaveToFile