GetXElementNodeList

This activity is used to get the list of elements present in a specific node. This activity
does not require the GetXmlObject scope for it to be executed. We can enter the file
path and other details directly into this activity to get the list of elements present in
this node.

Technical Reference

 

 

 

 

 

INPUT

ElementName: Specify the name of the element for which the list of elements must be extracted.

InputFilePath: Specify the input file path from which the element has to be extracted.

File: Choose the input type as File, Content or Element from the drop down.

Namespace: Specify the URL present in the XML file, from which the text has to be extracted. This is mandatory if the file type is file.

 

XElement: Specify the XElement variable in which the node has been stored.This is mandatory if the file type is element.

XElementContent: Specify the Content in the XML file within the string. This is mandatory if the file type is content.

 

 

 

 

 

MISC

DisplayName: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

SkipOnError: It specifies whether to continue executing the workflow even if it throws an error. This supports only Boolean value “True or False”. By default, it is set to “False.”

True: Continues the workflow to the next step

False: Stops the workflow and throws an error.

Version: It specifies the version of the XML automation feature in use

OUTPUT

ListofXElementNode: Declare a variable here to view the list of elements extracted from the given input file.



*Mandatory fields to execute the workflow

Use Case

The following activity illustrates on how we can use the GetXElementNodeList
activity to count the number of food items present in the given xml file.
We can use the GetXElementNodeText activity to view each text in the list.

Steps to execute the bot

1.      Drag and drop the GetXElementNodeList activity to the workflow.

2.      Specify the element name and the file path from which the element has to be
 extracted.

3.      Declare a variable in the ListofXElementNode box of the output segment. Here it
 is ListXElement.

4.      Drag and drop a writelog activity to the workflow.

5.      Enter the input string as ListXElement.Count.ToString, as we are going to take
 the count of the number food items in the file.

6.      Specify the log level as “info”.

7.      Execute the activity.

The bot executes the activity and extracts the details from the given file and gives
the output as 5, which is the number of elements present in the XML file.