Difference between revisions of "Extensions.Xml.CreateXmlElement"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''CreateXmlElement'''}}Category:Xml == Classification == {{ClassificationActivity | CreateXmlElement | UPDATING... | Term | Extensions.Xml|OTX Xm...")
 
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''CreateXmlElement'''}}[[Category:Xml]]
 
{{DISPLAYTITLE:OTX '''CreateXmlElement'''}}[[Category:Xml]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | CreateXmlElement | UPDATING... | [[Term]] | [[Extensions.Xml|OTX Xml extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | CreateXmlElement|Creates a new '''XmlElement'''.| [[Term]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Terms|Xml related Terms]] | - | [[Extensions.Xml.XmlChk002|Xml_Chk002]]|}}
  
 
== 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);
+
XmlElementTerm = Xml.CreateXmlElement(StringTerm, StringTerm, MapTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
The '''CreateXmlElement''' term is used to create a new '''XmlElement'''. Special characters '<', '>' and '&' shall be escaped.
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}}
+
{{TermReturnValue| [[Extensions.Xml.XmlElement|XmlElement]] | The new '''XmlElement'''.}}
{{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| Attributes|[[Core.DataTypes.ComplexDataType.Map|Map]] | [[Term]] | - |[0..1]| Contains a map of name<string>/value<string> pairs representing the attributes of the '''XML''' element. The attribute order is not specified. The name can contain an arbitrary namespace in form of "Prefix:Name".}}
 +
{{TableRowPropertie1|Name|[[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - |[1..1]| The name of an '''XML''' element. The value can contain an arbitrary namespace in form of "Prefix:Name".}}
 +
{{TableRowPropertie2| Text|[[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - |[0..1]| The string representation of the text of an '''XML''' element.}}
 
|}
 
|}
-->
 
  
 
== 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;
+
Xml.XmlElement XmlElement1;
 
+
myComCannel = DiagCom.GetComChannel("DiagnosticsCan_ECU_1", null, false);
+
/// Flow
  
// Code example using the variable myComChannel
+
XmlElement1 = Xml.CreateXmlElement("root", "text", {"attr":"val"});
// ...
 
DiagCom.CloseComChannel(myComCannel);</syntaxhighlight>
 
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== See also ==
 
== See also ==
UPDATING...
+
[[Extensions.Xml.CopyXmlElement|CopyXmlElement]]<br/>
 +
[[Extensions.Xml.CreateXmlDocument|CreateXmlDocument]]<br/>
 +
<!--[[Extensions.Xml.CreateXmlElement|CreateXmlElement]]<br/>-->
 +
[[Extensions.Xml.GetXmlElementAttributes|GetXmlElementAttributes]]<br/>
 +
[[Extensions.Xml.GetXmlElementChildElements|GetXmlElementChildElements]]<br/>
 +
[[Extensions.Xml.GetXmlElementName|GetXmlElementName]]<br/>
 +
[[Extensions.Xml.GetXmlElementsByXPath|GetXmlElementsByXPath]]<br/>
 +
[[Extensions.Xml.GetXmlElementText|GetXmlElementText]]<br/>
 +
[[Extensions.Xml.GetXmlRootElement|GetXmlRootElement]]<br/>
 +
[[Extensions.Xml.XmlFromByteField|XmlFromByteField]]<br/>
 +
[[Extensions.Xml.XmlLoadFromFile|XmlLoadFromFile]]<br/>
 +
[[Extensions.Xml.XmlToByteField|XmlToByteField]]<br/>

Revision as of 11:19, 8 October 2018

Classification

Name CreateXmlElement
Short Description Creates a new XmlElement.
Class Term
Extension OTX Xml extension
Group Xml related Terms
Exceptions -
Checker Rules Xml_Chk002
Standard Compliant Yes

OTL Syntax

XmlElementTerm = Xml.CreateXmlElement(StringTerm, StringTerm, MapTerm);

Description

The CreateXmlElement term is used to create a new XmlElement. Special characters '<', '>' and '&' shall be escaped.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
XmlElement The new XmlElement.

Properties

Name Data Type Class Default Cardinality Description
Attributes Map Term - [0..1] Contains a map of name<string>/value<string> pairs representing the attributes of the XML element. The attribute order is not specified. The name can contain an arbitrary namespace in form of "Prefix:Name".
Name String Term - [1..1] The name of an XML element. The value can contain an arbitrary namespace in form of "Prefix:Name".
Text String Term - [0..1] The string representation of the text of an XML element.

OTL Examples

Xml.XmlElement XmlElement1;
		
/// Flow

XmlElement1 = Xml.CreateXmlElement("root", "text", {"attr":"val"});

See also

CopyXmlElement
CreateXmlDocument
GetXmlElementAttributes
GetXmlElementChildElements
GetXmlElementName
GetXmlElementsByXPath
GetXmlElementText
GetXmlRootElement
XmlFromByteField
XmlLoadFromFile
XmlToByteField