Getting specific xml value

How can I get this all values between cbc:Note element ?

First I have used read text file activity to read xml file and then deserialize XML activity.
I have already added cbc namespace as “urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2”

data.Element(cbc+“Note”).Value is not working.

here is the template of xml file.1_TEMEL_FATURA - Copy.xml (101.9 KB)

Can you let me know which tag value you want to get in the entire XML? @asaltinsoy

Try this: uipath.com/kb-articles/how-to-iterate-and-read-xml-documents

I wanted to take “cbc:Note***</cbc:Note>”

@Ellboy I have already looked at this article. But this is not same as my xml problem.

Here are the steps you need to do:

  1. use deserialize xml and paste the entire xml in it. remember, you need to replace all the double quotes with single quotes in the xml

image

  1. Use get xml nodes activity to get all the nodes with in the xml and loop through the output as in the screenshot. xmldoc is the output of deserialize xml and xmlNodes is the output of get xml nodes activity. LocalName will give you all the child element names and we are getting the value of Note tag here…

image

3 Likes

@HareeshMR, thanks for your detailed answer.
While I’m typing the condition if activity, I could not use item.Name or item.value

How can I use name and value property of item ?

Thanks again.

Yeah clicking on the for each activity,change the item to xelement type by selecting browse types … then it will work

1 Like

Did that works @asaltinsoy

@HareeshMR I have already changed TypeArgument of ForEach with a mistake :slight_smile:

It works :wink: Thanks a lot for all your help.

Haha, what type you have changed that?
@asaltinsoy

@HareeshMR

I have used same variable type of “Get XML Nodes” 's output variable. Then ı have changed and problem has solved.

Thanks.

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