Reading XML files - Deserialize XML activity

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"?>

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 :slight_smile:

readingXMLvalues.xml (1.1 KB)

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

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

as mentioned:

so check the typeargument:
grafik

got it! Thank you for your quick reply

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