Deserializing XML


#1

Hello,

I have a problem with deserializing XML file. I have checked similar topics and while they are mostly about loops and how to extract searched information, I am unable to deserialize the file in the first place… The UiPath ‘How to…’ mentions ‘DeserializeXML’ activity, where you insert string input and XDocument output, but I cannot locate such activity in my UiPath.

I have checked all the packages and all of them are installed and there are no updates available. Do you have any idea what might be the case? Is there any other way to deserialize XML?

Thanks in advance :slight_smile:


#2

Hi,

you can Parse the string to a xdoc. myXDocument = XDocument.Parse(myString)

BR,
Topi


#3

I tried it and there is some kind of error. Here’s what I did:

Of course, earlier I assigned Directory.GetFiles to XMLfiles variable


#4

What does the error say? Can you expand the assign activity so that it shows entire statement.

-Topi


#5

The statement:

XMLtoString is a variable assigned to the output of read text file activity.

The error:

Thank you for your time, btw :wink:


#6

Your variable XMLed needs to be of type XDocument, not GenericValue. And just to be sure XMLtoString as a string type.

-Topi


#7

Damn, you are absolutely right. I missed that :slight_smile:
Thanks for your help :slight_smile: