AppendChild

AppendChild 1:

This method inserts a new node below an existing node. The value of the new node is of the data type STRING. The name and the value of the new node as well as a reference to the existing node are transferred to the method as input parameters. The method returns a reference to the newly added node. The input parameter cdata indicates whether the value of the node is to be encapsulated in a CDATA function block, so that certain special characters such as "<" and ">" are allowed as values.

Syntax

METHOD AppendChild : SXmlNode
VAR_INPUT
  n     : SXmlNode;
END_VAR
VAR_IN_OUT CONSTANT
  name  : STRING;
  value : STRING;
END_VAR
VAR_INPUT
  cdata : BOOL;
END_VAR

AppendChild 2: Return value

Name

Type

AppendChild

SXmlNode

AppendChild 3: Inputs

Name

Type

n

SXmlNode

cdata

BOOL

AppendChild 4:/AppendChild 5: Inputs/Outputs

Name

Type

name

STRING

value

STRING

Sample call:

xmlNewNode := fbXml.AppendChild(xmlExisting, 'Controller', 'CX5120', FALSE);