my xml is somehting like this:
<loc id="123">
<value>data1</value>
</loc>
<loc id="223">
<value>data2</value>
</loc>
<loc id="323">
<value>data3</value>
</loc>
<loc id="423">
<value>data4</value>
</loc>
how do I read all the ids?
this code give me only the first id (123). when it loops to next, throws exception.
XmlNodeList xmlnode = xmldoc.GetElementsByTagName("loc");
for (int x = 0; x < xmlnode.Count; x++)
{
XmlAttributeCollection xmlattrc = xmlnode[x].Attributes;
string id = xmlattrc[x].Value;
}