XML Extraction - Handling Namespaces (Tableau, Soap, OASIS types)

Hello lovely UIPathers :slight_smile:
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:
grafik

Checking if we have to handle XML namespaces

We do have:
grafik

Checking for some children:
grafik

Defining Namespace Variable
grafik

Checkin the retrieval
grafik

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"
3 Likes

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.