Object reference not set to an instance error when trying to do a simple parse of an xml file

Hello,

I have been getting object reference not set to an instance error when trying to print out a specific tag value of an xml file. I have tried this same code (except the string on the ‘Write Line’ activity of course since it is specific to this xml) on another xml file and it works so I am just trying to figure out why it doesn’t on this xml, maybe I am getting the tag (string in the ‘Write Line’ activity) wrong? the error is thrown at the write line activity. I have attached a screenshot of the code and a snippet of the xml data below
image
image

Thanks

you will need to handle the XML Namespaces as described here:

Do I need to append the namespace variable I create whenever I want to refer to a tag as in:

xmlDeserialized.Element(xmlNameSpace +“TXLife”).ToString() instead of just xmlDeserialized.Element(“TXLife”).ToString()

And does this apply to only certain kind of XMLs b/c it was working on another xml file without the namespace

@anan.deneke
we recommend to reread the shared link

Especially within the first part we do the analysis of the involved namespaces

Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

YourXDocVar.Root.Name was used for this
Similar we checked for children
YourXDocVar.Root.Descendants()(YourCheckIndex).Name

About:

Sure, when XML does not define a Namespace we dont have to handle

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