i tried many solution but did not worked, there is a namespace i tried to work with namespace manager that also not worked.
tried to convert xml into datatable got the below error
Xml to data table: ‘tns’ is an undeclared prefix. Line 1, position 2.
when i deserialize the XML i get the same error.
Can anyone know the other solution for my question??
Any help would be appreciated.
@pradyumn.agrawal
let us break down step by step and try to get it solved.
When you deserialze the XML string with the deserialize activity you will get back Datatype XDocument.
For with dealing with namespaces on a XDocument you have to work with XNamespaces.
Have a look here:
so in a first step I would suggest to identify a XML element of interest, setup the XNamspaces as done in the sample from link above and retrieve the element.
Once this is working we can go the next step.
Before doing any action check that your XML is valid and without any structure isues, as this will disturb the work
@pradyumn.agrawal
Demo xamls should not be opened directly.
Download the xaml into your UiPath Project.
Ensure the dependency Manager is configured to reference UiPath.Web.Activities.
this the test if we can access the root. If this is working then setup the XNamespace for this namespace and check if you can access the root element with xDoc.Element(yournamspacevar+“CollaborationProtocolAgreement”).Name.toString
The main idea behind this automation is to replace the incorrect data with Correct one.
There is one incorrect certificate in the XML and i have to replace with correct certificate.
The correct one lies just above the incorrect one
i have given you XML file if you check from line 937 to 974 (Open in Notepad++) is the correct data between <ds:keyinfo > < /ds:Keyinfo>
rest of the data in file will remain same only this piece of information will be change
i mean incorrect part will be removed and we have to copy from < ds:Keyinfo></ds:Keyinfo > and paste in place of removed part.
Note: KeyInfo tags contain all the information which we need.
I hope you understand what i am trying to achieve, Please let me know if you any doubt
@pradyumn.agrawal
Please have a check on this next version. Download it into your UiPath project and reassign the FilePath to xml according to your end