How to read a node in an xml in this format

fullerriyadh

New Member
I have an getting an xml response on this format\[code\] <?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n <PlatformResponse xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://platform.intuit.com/api/v1\">\r\n <ErrorMessage>OAuth Token rejected</ErrorMessage>\r\n <ErrorCode>270</ErrorCode>\r\n <ServerTime>2012-06-19T00:01:31.5150146Z</ServerTime>\r\n</PlatformResponse>\[/code\]I need to grab the value in the \[code\]<ErrorCode>\[/code\] node, for that I did the following but it is not getting any values..\[code\] XmlDocument xml = new XmlDocument(); xml.LoadXml(xmlResponse); XmlNodeList xnList = xml.SelectNodes("PlatformResponse"); foreach (XmlNode xn in xnList) { result.Message = xn["ErrorCode"].InnerText; }\[/code\]Any help would be much appreciated.
 
Back
Top