Difference between revisions of "Extensions.Xml.SetXmlComment"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''SetXmlComment'''}}Category:Xml == Classification == {{ClassificationActivity | SetXmlComment | UPDATING... | Action | Extensions.Xml|OTX Xml ex...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''SetXmlComment'''}}[[Category:Xml]]
 
{{DISPLAYTITLE:OTX '''SetXmlComment'''}}[[Category:Xml]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | SetXmlComment | UPDATING... | [[Action]] | [[Extensions.Xml|OTX Xml extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | SetXmlComment| Sets a comment above the root '''XmlElement'''.| [[Action]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Actions|Xml related Actions]] | - | -|}}
  
 
== 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.SetXmlComment(XmlDocumentTerm document, StringTerm comment, BooleanTerm append);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
The '''SetXmlComment''' action is used to set a new comment directly above the root '''XmlElement'''.
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| Append| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | [[Term]] | - | [0..1] | Boolean term, which describes if a new comment will be added or not. If it is set to FALSE, all existing comments will be deleted. Default &#x0003D; FALSE.}}
 +
{{TableRowPropertie1| Comment| [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1..1] | String representation of an '''XML''' comment. The string provided is inserted directly between the opening and closing comment marks. Sample: "comment" becomes "<!--comment-->".}}
 +
{{TableRowPropertie2|Document | [[Extensions.Xml.XmlDocument|XmlDocument]] | [[Term]] | - | [1..1] |The '''XmlDocument''' object, to which the operation is applied.}}
 
|}
 
|}
-->
 
  
 
== 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.XmlDocument XmlDocument1;
  
// Code example using the variable myComChannel
+
/// Flow
// ...
+
 
DiagCom.CloseComChannel(myComCannel);</syntaxhighlight>
+
XmlElement1 = Xml.CreateXmlElement("root", "roottext");
 +
XmlDocument1 = Xml.CreateXmlDocument(XmlElement1, "1.0", @Encoding:UTF-8, false);
 +
Xml.SetXmlComment(XmlDocument1, "Comment 1", false);
 
</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 05:39, 8 November 2018

Classification

Name SetXmlComment
Short Description Sets a comment above the root XmlElement.
Class Action
Extension OTX Xml extension
Group Xml related Actions
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

Xml.SetXmlComment(XmlDocumentTerm document, StringTerm comment, BooleanTerm append);

Description

The SetXmlComment action is used to set a new comment directly above the root XmlElement.

Properties

Name Data Type Class Default Cardinality Description
Append Boolean Term - [0..1] Boolean term, which describes if a new comment will be added or not. If it is set to FALSE, all existing comments will be deleted. Default = FALSE.
Comment String Term - [1..1] String representation of an XML comment. The string provided is inserted directly between the opening and closing comment marks. Sample: "comment" becomes "".
Document XmlDocument Term - [1..1] The XmlDocument object, to which the operation is applied.

OTL Examples

/// Local Declarations

Xml.XmlElement XmlElement1;
Xml.XmlDocument XmlDocument1;

/// Flow

XmlElement1 = Xml.CreateXmlElement("root", "roottext");
XmlDocument1 = Xml.CreateXmlDocument(XmlElement1, "1.0", @Encoding:UTF-8, false);
Xml.SetXmlComment(XmlDocument1, "Comment 1", false);

See also

AddXmlChildElement
DeleteXmlAttribute
DeleteXmlChildElement
SetXmlElementAttribute
SetXmlElementAttributes
SetXmlElementText
SetXmlProcessingInstructions
ValidateXml
XmlSaveToFile