xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom">
pushpin_hl
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rahul Bhatt165 reputationPosted Jul 19, 2012, 11:26 PM EDT
private void ReadXMLfile()
{
XmlDataDocument xmldoc = new XmlDataDocument();
string filepath = Server.MapPath("KML.xml");
XElement elmRoot = XElement.Load(filepath);
string longitude;
string latitude;
var v = (from page in elmRoot.Elements().Elements().Elements().Nodes()
select page);
if (v != null)
{
foreach (var item in v)
{
if (((XElement)item).Name.LocalName == "longitude")
{
longitude = ((XElement)item).Value;
}
if (((XElement)item).Name.LocalName == "latitude")
{
latitude = ((XElement)item).Value;
}
}
}
}