Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi

i have xml like

HTML
<rsp stat="ok"><cell lat="51.8820140666667" mcc="262" lon="8.04184843333333" cellid="45964" nbsamples="1" mnc="1" lac="2348" range="6000" /></rsp>

from this how can i get the values of lat and lon in some string like




string lat="51.8820140666667"<br />
string lon="51.8820140666667"


any one please help me
Posted
Updated 6-Jan-13 18:01pm
v4

C#
XDocument ele = XDocument.Load(@"path of xml file");
string lon = ele.Element("rsp").Element("cell").Attribute("lon").Value.ToString();
string lat = ele.Element("rsp").Element("cell").Attribute("lat").Value.ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900