Hi
I am having issues reading this specific XML file when using the Deserialize XML activity.
Im looking to read the property name and value for each element.
Currently, i can read every node but not the nodes inside using the code attached.
<?xml version="1.0"?>
ppr
(Peter)
January 8, 2023, 4:02pm
2
May we ask you to share the XML as text file with us, Thanks
Deserialize XML - out: xDoc
For each activity | item in xDoc.Root.Descendants("property")
| TypeArgument: XElement
log message: item.Attribute("name").Value
log message: item.Attribute("value").Value
Hi @RPA_Canada ,
Some XML include different name space between attribute must added to get the value agree with @ppr to share XML file with us for support
Which attribute you can not read ?
ZZ_103_DeserializePost.xaml (10.7 KB)
Im looking to read : the following values for each node id
The goal is to have the following values into a datatable
<property name="x" value="738"/>
<property name="y" value="673"/>
<property name="number" value="+123456789"/>
<property name="timeout" value="30"/>
<property name="onTimeout" ref=""/>
<property name="confirmCallPickup" value="false"/>
Please find attached the xaml file
ppr
(Peter)
January 8, 2023, 4:41pm
7
Find following starter help:
typeArguments of the different fore each are set to XElement:
item = xDoc.Root.Descendants("node")
item.Attribute("id").Value
item2 = item.Elements("property")
"Name: " & item2.Attribute("name").Value
attrName = {"ref","value"}.Where(Function (x) item2.Attributes.Any(Function (a) a.Name.LocalName.Equals(x))).First()
attrName + ": " + item2.Attribute(attrName).Value
Log:
3 Likes
Thank you for your help.
recreated the secuence, however i got an error on the first log message.
please, I would love to take a look on your xaml file to compare with my solution
I got the following error:
Thank you for your help
ppr
(Peter)
January 8, 2023, 7:02pm
9
as mentioned:
so check the typeargument:
RPA_Canada
(RPA_Canada)
January 8, 2023, 7:27pm
10
got it! Thank you for your quick reply
system
(system)
Closed
January 11, 2023, 7:28pm
11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.