I believe that I'm trying to do something incredibly simple. Yet, I can't figure out a clean way to do it. I have some XML that looks like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.somedomain.com/Response.xsd">
<Results>
<Result>
<ID>1</ID>
<Name>John Smith</Name>
<Latitude>41.365736</Latitude>
<Longitude>-82.511756</Longitude>
</Result>
<Result>
<ID>2</ID>
<Name>Bill Appleseed</Name>
<Latitude>31.164736</Latitude>
<Longitude>-72.611356</Longitude>
</Result>
</Results>
</Response>
I need to parse this XML and load it into some CLR objects. Currently, I'm doing the following:
string response = GetXml();
XDocument xml = XDocument.Parse(response);
Beyond that, I'm stuck. No matter what I try, I get some error. Either a null pointer exception or something else. Can someone show me how you would tackle this problem?
Thanks!