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

As I am begienner... Kindly help in finding the solution ---- i am using a webservice, api which will return data in XML formant.

I will pass IP Address in WebService/API. This will return this data ....
XML
<Locations>
 <Location id="0">
    <Ip>74.125.45.100</Ip>
    <Status>OK</Status>
    <CountryCode>US</CountryCode>
    <CountryName>United States</CountryName>
    <RegionCode>06</RegionCode>
    <RegionName>California</RegionName>
    <City>Mountain View</City>
    <ZipPostalCode>94043</ZipPostalCode>
    <Latitude>37.4192</Latitude>
    <Longitude>-122.057</Longitude>
 </Location>
</Locations>

Problem is I want to show data CITY,COUNTRY,STATE in Label.

Kindly tell me the logic - how to read data from this XML Format? How to match them?
Kindly provide me the code, as this XML is generated by API?
Thanks a lot
Posted
Updated 29-Aug-10 4:43am
v2

1 solution

You can look here[^] to learn more about XPath, which what you will need to access the appropriate elements in the XML fragment.

Since you didn't say where or how you were using the web service, Win app, ASP.NET, PHP, JavaScript, it would be difficult to give a more specific answer.
 
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