Difference between revisions of "Extensions.Xml.GetXmlElementText"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''GetXmlElementText'''}}Category:Xml == Classification == {{ClassificationActivity | GetXmlElementText | UPDATING... | Term | Extensions.Xml|OTX...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''GetXmlElementText'''}}[[Category:Xml]]
 
{{DISPLAYTITLE:OTX '''GetXmlElementText'''}}[[Category:Xml]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | GetXmlElementText | UPDATING... | [[Term]] | [[Extensions.Xml|OTX Xml extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | GetXmlElementText|Returns the text of an '''XML''' element| [[Term]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Terms|Xml related Terms]] | - | - |}}
  
 
== 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);
+
StringTerm Xml.GetXmlElementText(XmlElementTerm eElement);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
The '''GetXmlElementText''' term returns the text of an '''XML''' element as a String. If no text is available an empty string is returned. Escaped special characters shall be unescaped.
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}}
+
If the element contains CDATA's the returned string contains the content of the CDATA section as it is. If the element contains multiple text and/or CDATA nodes, the returned String is the concatenation of all these nodes.
{{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!}}
+
 
-->
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | The text of an '''XML''' element.}}
  
 
== Properties ==
 
== Properties ==
UPDATING...<!--
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| ComChannel | [[Extensions.DiagCom.ComChannel|ComChannel]] | [[Variable]] | - | [1] | Communication Channel (Control unit).}}
+
{{TableRowPropertie2| Element|[[Extensions.Xml.XmlElement|XmlElement]] | [[Term]] | - |[1..1]| The '''XmlElement''' 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
 +
 
 +
Xml.XmlElement XmlElement1;
 +
String String1 = "";
  
myComCannel = DiagCom.GetComChannel("DiagnosticsCan_ECU_1", null, false);
+
/// Flow
  
// Code example using the variable myComChannel
+
XmlElement1 = Xml.CreateXmlElement("root", "abc");
// ...
+
String1 = Xml.GetXmlElementText(XmlElement1);
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/>

Latest revision as of 05:58, 8 November 2018

Classification

Name GetXmlElementText
Short Description Returns the text of an XML element
Class Term
Extension OTX Xml extension
Group Xml related Terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

StringTerm Xml.GetXmlElementText(XmlElementTerm eElement);

Description

The GetXmlElementText term returns the text of an XML element as a String. If no text is available an empty string is returned. Escaped special characters shall be unescaped.

If the element contains CDATA's the returned string contains the content of the CDATA section as it is. If the element contains multiple text and/or CDATA nodes, the returned String is the concatenation of all these nodes.

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
String The text of an XML element.

Properties

Name Data Type Class Default Cardinality Description
Element XmlElement Term - [1..1] The XmlElement object, to which the operation is applied.

OTL Examples

/// Local Declarations

Xml.XmlElement XmlElement1;
String String1 = "";

/// Flow

XmlElement1 = Xml.CreateXmlElement("root", "abc");
String1 = Xml.GetXmlElementText(XmlElement1);

See also

CopyXmlElement
CreateXmlDocument
CreateXmlElement
GetXmlElementAttributes
GetXmlElementChildElements
GetXmlElementName
GetXmlElementsByXPath
GetXmlRootElement
XmlFromByteField
XmlLoadFromFile
XmlToByteField