Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Read XML data

$
0
0

Hi, I'm new to xamarin
I'm using this code to extract query/city data from xml

            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(url);

            string xpath = "//query/city";
            var nodes = xmlDoc.SelectNodes(xpath);
             foreach (XmlNode childrenNode in nodes)
           {
                outputLabel.Text += childrenNode.SelectSingleNode("//city").Value;
            }

but I get this error ;
xdocument index was outside the bounds of the array
How can i fix this error

Thank you in advance


Viewing all articles
Browse latest Browse all 204402


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>