RPA | A2019 XML Command/Package| Automation Anywhere - Part-29
A2019 XML Command - A2019 XML package provides various actions that are used to perform various XML related actions such as get node, execute Xpath expression etc.
Before we start discussing more about A2019 XML command first we will discuss what is an XML command and after that we will explore various options as to how we can extract data from an XML file using the various actions provided under the XML package.
What is XML?
XML or Extensible Markup Language is a markup language is designed to store and transport data. The format or XML structure looks something like this as given below.
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>Python Developer Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk112">
<author>Galos, Mike</author>
<title>Visual Studio 7: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>49.95</price>
<publish_date>2001-04-16</publish_date>
<description>Microsoft Visual Studio 7 is explored in depth,
looking at how Visual Basic, Visual C++, C#, and ASP+ are
integrated into a comprehensive development
environment.</description>
</book>
</catalog>
Now we will discuss the actions that are provided under the A2019 XML Package which are as follows:-
- Start Session - This command is basically used to start the XML session. This session is required for further usage of actions that we will be using further in our process. In the properties section we need to pass in the session name and then we can either select the xml file from the required folder location or we can directly pass in the xml input as text.
- Get Single Node - This action is used to retrieve the value of specific node from the XML file. In the properties section we need to pass the xml session that we used in the start session action, then give the xpath expression to retrieve the node value and store the output in a variable of string data type.
- Get Multiple Nodes - This command is used to retrieve value from multiple xml nodes. In the properties section we need to input the session name that we used in the start session command, then enter the xpath expression and finally we need to select how we need to get the node either as text value, xpath expression or specific attribute name.
- Execute XPath function - This command is used to execute the xpath function on the given xml file. In the properties section we need to input the session name that is being passed in the start session action, then enter the xpath expression to retrieve the values and store the output to a string variable data type.
- Save Session Data - This command is used to save the XML session data. In the properties section we need to pass the session name that we had given in the start session action, then check the Write XML Data and then give the file path where we need to save the xml file and then store the output in a string variable data type.
- Insert Node - This command is used to insert the node within the xml. In the properties section we need to pass the session name given in the start session action, then give the xpath expression, give the node name and the node value, then specify the action that we need to perform if the node is present, last but not the least specify the location where we need to insert the node.
- Delete Node - This action is used to delete the specific node from the xml. In the properties section we need to pass the session name which we had given in the start session action, then give the xpath expression used to delete the node from the xml file.
- End Session - This action is used to end the XML session. In the properties section we need to pass in the same session name which was earlier passed at the time of start session action.
- Update Node - This action is used to update specific node in the xml. In the properties section we need to pass in the session name, give the xpath expression to update the node and then pass the new value to replace with the old value in the xml.
Comments
Post a Comment
If you have any doubts, please letme know.