Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
hi
 
i have xml like
 
<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"
string lon="51.8820140666667"

 
any one please help me
Posted 6-Jan-13 18:56pm
Edited 6-Jan-13 19:01pm
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

 
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();
  Permalink  

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

  Print Answers RSS
0 DamithSL 405
1 OriginalGriff 245
2 Sergey Alexandrovich Kryukov 207
3 Peter Leow 185
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 7,460
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100