WFA_psychometric_chart.Form1_main.ProcessResponse C# (CSharp) Method

ProcessResponse() public method

public ProcessResponse ( XmlDocument locationsResponse ) : void
locationsResponse System.Xml.XmlDocument
return void
        public void ProcessResponse(XmlDocument locationsResponse)
        {
            //Create namespace manager
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(locationsResponse.NameTable);
            nsmgr.AddNamespace("rest", "http://schemas.microsoft.com/search/local/ws/rest/v1");

            //Get formatted addresses: Option 1
            //Get all locations in the response and then extract the formatted address for each location
            XmlNodeList locationElements = locationsResponse.SelectNodes("//rest:Location", nsmgr);
            Console.WriteLine("Show all formatted addresses: Option 1");
            foreach (XmlNode location in locationElements)
            {
                //MessageBox.Show("Lat = "+location.SelectSingleNode(".//rest:Latitude", nsmgr).InnerText);
                latVal = double.Parse(location.SelectSingleNode(".//rest:Latitude", nsmgr).InnerText);
                // MessageBox.Show("lat = " + latVal);
                longVal = double.Parse(location.SelectSingleNode(".//rest:Longitude", nsmgr).InnerText);
                // MessageBox.Show("Long = " + longVal);
            }
            //   Console.WriteLine();
        }
Form1_main