Hello -
I have a rest webservice that returns ODATA in XML. I am able to put the XML it returns into an XDocument but all attempts to query the content fail.
I think it is because the XML contains namespaces. I followed the online guidance for XML and proved that I can get at the content of the XDocument if I manually edit out all of the namespace references.
Where am I going wrong please?
Here is a fragment form the start of the XML (if have edited the namespace links to comply with the forum rules)
thanks for the response. I used DeserializeXML to create the XDocument and then a simple writeline to try to show the value of one of the XML elements.
I then tried XPath to query the XDocument.
In both cases the writeline activity throws and error that I am trying to access an object that does not exists. When I take out the namespace items it works fine.
I have looked for a namespace manager but could not find anything. I looked at the “imports” tab but that seems to relate to namespaces for packages.
I’m not saying this is the ideal solution because looks like you have valid namespaces but If it worked for you by ignoring the namespaces, here’s an option. I have an API that returns an XML file with namespaces that don’t resolve. Here’s a clip.