Given the following XML -
<Response>
<Item name="ItemA" />
</Response>
How do I get the value of the name attribute?
I have tried several ways with no luck, here was the last try- (Note that writing the contents of 'xml' to the console displayed the above XML)
Dim doc As XDocument = XDocument.Load(xml)
Dim result = From x In doc.Descendants("Item") Select x.Attribute("Name").Value
Console.WriteLine(result)
Results in output of: "System.Linq.Enumerable.WhereSelectEnumerableIterator[Of System.Xml.Linq.XElement, String]"
Thanks,