I have a problem in the programming process. I can not understand how to correctly display the information in the textbox from the XML file? Here is the code itself:
private void GetWeather() { string query = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22chisinau%2C%20md%22)&format=xml&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"; XmlDocument wData = new XmlDocument(); wData.Load(query); XmlNamespaceManager manager = new XmlNamespaceManager(wData.NameTable); manager.AddNamespace("yweather", "http://xml.weather.yahoo.com/ns/rss/1.0"); XmlNode channel = wData.SelectSingleNode("//channel"); XmlNode itemNode = channel.SelectSingleNode("item"); XmlNodeList forecastNodes = itemNode.SelectNodes("yweather:forecast", manager); string city = channel.SelectSingleNode("yweather:location", manager).Attributes["city"].Value; string humidity = channel.SelectSingleNode("yweather:atmosphere", manager).Attributes["humidity"].Value; string windSpeed = channel.SelectSingleNode("yweather:wind", manager).Attributes["speed"].Value; string[] temperature = new string[forecastNodes.Count+1]; string[] conditionText = new string[forecastNodes.Count+1]; temperature[0] = channel.SelectSingleNode("item").SelectSingleNode("yweather:condition", manager).Attributes["temp"].Value; conditionText[0] = channel.SelectSingleNode("item").SelectSingleNode("yweather:condition", manager).Attributes["text"].Value; for (int i=0; i<forecastNodes.Count; i++) { temperature[i+1] = forecastNodes[i].Attributes["low"].Value; conditionText[i+1] = forecastNodes[i].Attributes["text"].Value; } Help solve the problem.
XMLfile? - Yurii Manziuk