CopyAttributeText

CopyAttributeText 1:

This method reads the value of an XML attribute and writes it to a variable of data type String. The XML attribute as well as the target variable and the length to be written are passed to the method as input parameters. The method returns the actual size.

Syntax

METHOD CopyAttributeText : UDINT
VAR_INPUT
  a    : SXmlAttribute;
END_VAR
VAR_IN_OUT CONSTANT
  sXml : STRING;
END_VAR
VAR_INPUT
  nXml : UDINT;
END_VAR

CopyAttributeText 2: Return value

Name

Type

CopyAttributeText

UDINT

CopyAttributeText 3: Inputs

Name

Type

a

SXmlAttribute

nXml

UDINT

CopyAttributeText 4:/CopyAttributeText 5: Inputs/Outputs

Name

Type

sXml

STRING

Sample call:

nLength := fbXml.CopyAttributeText(xmlAttr, sTarget, SIZEOF(sTarget));