This activity is used to get the text from an XElementNode of an XML file. This activity
is used along with the GetXElementNodeList and GetXElementNode activity.
Technical Reference
INPUT |
XElement: Specify the variable declared in the GetXElementNode activity as the input in this activity. |
|
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 |
Text: Declare a variable here to see the text extracted from the specific node. |
*Mandatory fields to execute the workflow
Use Case
The following example illustrates how we can use this activity to get the text from
an XElementNode of an XML file. Here we are using the GetXElementNodeList
activity to get the specified nodes from a list in the xml file, and then we use the
GetXElementNode activity to extract the node from a specific position from the list
and then the GetXElementNodeText activity to get the text from the specified position.
Use the writelog activity to view the extracted text from the node.This activity does
not require the Xml scope to work.
Steps to execute the bot
1. Drag and drop the GetXElementNodeList activity to the workflow.
2. Click on the activity and navigate to the property section.
3. Specify the element name as “name” from which the text has to be extracted.
4. Specify the file path of the XML file.
5. Choose the input type as file.
6. Declare a variable in the ListofXElement box of the output segment in which the list
of nodes will be stored. Here the variable is “ListXElement”.
7. Now drag and drop the GetXElementNode activity to the workflow.
8. Give the input as ListXElement (above declared variable) to the ListofXElement box
in the input segment.
9. Mention the position from the list for which the text has to be extracted. Here we are
going to take the text from “position 3”
10. Declare a variable in the XElement box of the output segment. Here it is “XElement”.
11. Now drag and drop the GetXElementNodeText activity to the workflow.
12. Click on this activity and navigate to the property section.
13. Specify XElement( above declared variable) in the XElement box of the Input segment.
14. Declare a variable in the Text box of the output segment. Here it is “Text”.
15. Drag and drop a writelog activity to the workflow to see the output of the NodeText.
16. Execute the workflow.
The bot executes the workflow and gives the output as “Berry – Berry Belgian Waffles” which is
in the 3rd position of ”name” node.