XML Automation - GetXElementNode

GetXElementNode

When to use the GetXElementNode

Use this activity to get the specified Element Node along with its value, based on the given position from the XML input document.

Figure 1


1

After obtaining the node list count, (1) drag and drop a GetXElementNode activity from the XML package and assign it to the workflow. (2) Specify the output of the GetXElementNodeList activity as input in the GetXElementNode activity. (List of XElement Node) (3) Specify the Position from which the element node is to be extracted. (4) Declare a XElement variable type in the Output Property field (xElementNode) to obtain the specified element based on the given position.

Figure 2

2

Next, (1) Drag and drop a WriteLog activity and assign it to the GetXElementNode activity. (2) Provide the input string with the appropriate Syntax - “Preferred text” + output variable +. tostring as it gets the specified node and value based on specified position (3) Specify the Log level.

Figure 3

3

In the above workflow the Input String syntax in the WriteLog is as follows:

 

Figure 4

4

Execute the workflow. The output will display the selected 6th position’s Element Node along with its value as displayed in the following image.

Figure 5

5

Technical Reference

Figure 6

6

Version
5.1.1