ChildByAttributeAndName

ChildByAttributeAndName 1:

This method is used to navigate through the DOM. It returns a reference to a child element in the XML document. The start node, the name and value of the attribute, and the name of the child element are transferred to the method as input parameters.

Syntax

METHOD ChildByAttributeAndName : SXmlNode
VAR_INPUT
  n     : SXmlNode;
END_VAR
VAR_IN_OUT CONSTANT
  attr  : STRING;
  value : STRING;
  child : STRING;
END_VAR

ChildByAttributeAndName 2: Return value

Name

Type

ChildByAttributeAndName

SXmlNode

ChildByAttributeAndName 3: Inputs

Name

Type

n

SXmlNode

ChildByAttributeAndName 4:/ChildByAttributeAndName 5: Inputs/Outputs

Name

Type

attr

STRING

value

STRING

child

STRING

Sample call:

xmlMachine2 := fbXml.ChildByAttributeAndName(xmlMachines, 'Type', '2', 'Machine');