Difference between revisions of "Extensions.Xml.AddXmlChildElement"

From emotive
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 | UPDATING... | [[Action]] | [[Extensions.Xml|OTX Xml extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{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 ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagCom.CloseComChannel(ComChannelVariable);
+
Xml.AddXmlChildElement(XmlElementTerm parent, XmlElementTerm child, XmlElementTerm insertBefore);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
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.
OTX CloseComChannel activity is used for the [[Diagnosis Runtime System]] to announce that an open communication channel that all relevant resources can be released and closed.
 
{{ComChannelMemoryUsageNote}}
 
{{Important|Please note that the use of a shared '''ComChannel''' can bring the OTX runtime system in an undefined state and that is this case is not validated at design time!}}
 
-->
 
  
 
== Properties ==
 
== Properties ==
UPDATING...<!--
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| ComChannel | [[Extensions.DiagCom.ComChannel|ComChannel]] | [[Variable]] | - | [1] | Communication Channel (Control unit).}}
+
{{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 ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagCom.ComChannel myComCannel;
+
/// Local Declarations
  
myComCannel = DiagCom.GetComChannel("DiagnosticsCan_ECU_1", null, false);
+
Xml.XmlElement XmlElement1;
 +
Xml.XmlElement XmlElement2;
  
// Code example using the variable myComChannel
+
/// Flow
// ...
+
 
DiagCom.CloseComChannel(myComCannel);</syntaxhighlight>
+
XmlElement1 = Xml.CreateXmlElement("root", "text", {"attr":"val"});
 +
XmlElement2 = Xml.CreateXmlElement("child", "childtext", {"attr1":"val1"});
 +
Xml.AddXmlChildElement(XmlElement1, XmlElement2);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== See also ==
 
== See also ==
UPDATING...
+
<!--[[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