Extensions.Xml.SetXmlComment

From emotive
Jump to navigation Jump to search

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