Some business processes may consume the XML as an input/output to exchange data to/from a web server.
When receiving data from a web server, the data is always a string.
Let’s explore how to extract the field from an XML string!!!
Example
Implementation using UiPath :
Let us implement a workflow which reads a .XML file and extracts the required fields.
Step 1:
Drag “Read Text File” activity into the designer panel, pass the .XML file’s path to it and save the output to a string variable.
Please download the sample .xml file from the link mentioned at the bottom of the article.
Step 2:
Drag “Deserialize XML” activity into the designer panel to deserialize XML string. Supply the variable “xml_Data” to it as input and create a variable called “out_XML” of XDocument type.
Note: If you don’t find the “Deserialize XML” activity in the activities panel, then you have to install UiPath.Web.Activities package
Step 3:
Drag “For Each” activity into the designer panel and supply the below-mentioned parameters into it.
Values: out_XML.Element(“breakfast_menu”).Elements(“food”)
TypeParameter: System.XML.Linq.XElement
Step 4:
Use “Message Box” activities to display the contents.
Step 5:
Finally, run the project 🙂
Name:
Price:
Description:
Click here to download the Source Code…
Hope it has helped you…
i write a code of extract multiple images text in folder and the happend is only last image text stored in notepad file but i want all images text using uipath tool please could sugguest any solution
Sure Haswanth, are you storing all the values into same .txt file different .txt files?
Definitely Haswanth, are you using the same notepad to store all the values?