Hello lovely UIPathers
I am hoping someone can guide me towards how I can extract the restAPIVersion from this deserialized XML:
Tried just about everything I can think of without success & grateful for any pointers.
Thank you!
Hello lovely UIPathers
I am hoping someone can guide me towards how I can extract the restAPIVersion from this deserialized XML:
Tried just about everything I can think of without success & grateful for any pointers.
Thank you!
@aidan.moore
Welcome to the forum
you may have to handle XML namespaces
Have a look here
Maybe you can share the XML as text with us
Going ahead
Serializing the XML - output: xDoc | DataType: XDocument:
Checking if we have to handle XML namespaces
We do have:
Checking for some children:
Defining Namespace Variable
Checkin the retrieval
xDoc.Descendants(xnsDefault + "productVersion")
GetDescendants { [<productVersion build="456" xmlns="http://tableau.com/api">123</productVersion>] }
xDoc.Descendants(xnsDefault + "productVersion").First().Value
"123"
xDoc.Descendants(xnsDefault + "productVersion").First().Attribute("build").Value
"456"
xDoc.Descendants(xnsDefault + "restApiVersion").First().Value
"3.12"
Thanks Peter!
Annoyingly I had squiggly brackets around the XNamespace until I read your solution.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.