How to read XML files correctly?

Hello !

I’m trying to read a xml file and I want to make sure that I’m doing correctly. In my example I am using string manipulation to find a specific string allocated in XML Node. I’ve searched a lot of contents to read this file using Deserialize XML activity or Get XML Nodes, but all of them couldn’t help me.
How to use those activities correctly to read XML files without using string manipulation?

That’s my actual process:
Read text file (to recognize the xml file)

Assing: xml_node = xml_file.Substring(xml_file.IndexOf("") + “”.Length).Split(Environment.NewLine.ToCharArray)(0)

Assing: xml_node = xml_node.Split(".“c).First.ToString.Substring(xml_node.LastIndexOf(”"))

Assing: xml_node = xml_node.Remove(xml_node.IndexOf(""))

Assing: xml_node = xml_node.replace("","").ToString

Write Line “xml_node” (to write on the console, checking if the string between the nodes has found)

Thanks :wink:

@Vitor_Vicente

Welcome to forums

Can you share a sample xml document and output required?

Thanks

I can’t send the file in .xml because is an invoice, but I’ve modified to send the example
Is something like this:

Sale
75
1
12345
3191.00
W.John, Ave.
NY
NY
United States
xxxxxxxx

I have to identifiy the strings (and numbers) between the nodes, like the invoice number, city and amount.

image

Hi use Deserialize XML activity as shown in video:
23:50​ Deserialize XML
image

@Vitor_Vicente

Check below for your reference

This includes a sample example also

Hope this may help you

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.