XDocument.Load throwing error

We have a string variable assigned as: Path=“Data\Input.xml”
Now we need to load this xml file data in a variable named xDoc of the type XDocument
xDoc=XDocument.Load(Path)

I’m getting an error saying: Assign: ‘â’ is an unexpected token. The expected token is ‘"’ or ‘’'. Line 1, position 15.

we can use:

Deserialise XML Activity (UiPath.WebApi.Activities Package)
OR:
Code Statements

But it will only work for Valid XML. Currently does the Parser complain the XML and rate it as invlid.

  • From where is the XML coming from
  • how does it look when inspecting it as plain text?

Hi peter,

Tried deserialize xml as well by passing string input, no use.
I have created a notepad document & converted to .xml and using in my use case

When we open in notepad it looks like below
image

ensure that the correct double quotes are used:
grafik

" is needed

1 Like

Thankyou so much Peter :slightly_smiling_face:

When I edited in notepad, double quotes appeared differently. So I did using Word pad " " and now its working fine

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