FrenchyRPA
(Robinmoguerou)
January 17, 2024, 1:19pm
1
Hi, i’m trying to get datas from an XML and put them in a Datatable (for each workers datas), but I got that error when I try to parse my XML : “Assign xeWorkers - xElements: Namespace prefix ‘wd’ is not defined.”
Test.xaml (92.2 KB)
TestResponseXML.xml (50.1 KB)
Attached is a test file xml and the workflow
Can someone help ? Struggling for a long time lol, thanks!
mkankatala
(Mahesh Kankatala)
January 17, 2024, 1:20pm
2
Hi @FrenchyRPA
Check out this thread. This will help you.
I have a xml file like this:
[image]
My workflow:
[image]
When i call:
xmlDoc.Element(“HSoKhaiThue”).Element(“TTinChung”).Element(“TTinDVu”).Element(“maDVu”).Value
Log Message: Object reference not set to an instance of an object.
Help me !!!
Regards
FrenchyRPA
(Robinmoguerou)
January 17, 2024, 1:22pm
3
Hi, thanks for your reply.
I tried that already but In my case I need to do a loop through the XML so it’s a bit more difficult then this one
mkankatala
(Mahesh Kankatala)
January 17, 2024, 1:47pm
4
Did you check out this thread @FrenchyRPA
Hi,
Your xml seems wrong format because there is no end tag for Sct ( no start tag for Cst).
[image]
If it’s Cst, the following sample will help you.
[image]
Sample20230715-1aL.zip (2.9 KB)
Regards,
Hope this will help
Regards
Yoichi
(Yoichi)
January 17, 2024, 1:48pm
5
Hi,
How about using basic method of XDocument class instead of XPath?
xeWorker = xmldeserialized.Descendants(xnsWD+"Worker_Data")
Regards,
ppr
(Peter Preuss)
January 17, 2024, 1:52pm
6
FrenchyRPA
(Robinmoguerou)
January 17, 2024, 2:09pm
7
Maybe I can try that, but how to get the data for each worker after that ? I’m trying but not working for now
Thanks
Yoichi
(Yoichi)
January 17, 2024, 2:20pm
8
Hi,
Can you try to modify them one by one.
For example, next Assign will be as the following.
nameDetailsXE = ThisWorkerXE.Element(xnsWD+"Personal_Data").Element(xnsWD+"Name_Data").Element(xnsWD+"Legal_Name_Data").Element(xnsWD+"Name_Detail_Data")
name_WD = nameDetailsXE.Attribute(xnsWD+"Formatted_Name").value
Regards,
FrenchyRPA
(Robinmoguerou)
January 17, 2024, 2:36pm
9
Ok I see now how to do it, thanks a lot i’m sorted for now!
1 Like
system
(system)
Closed
January 20, 2024, 2:37pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.