Read data from XML Feed

This url returns weather data from the BBC:

http://open.live.bbc.co.uk/weather/feeds/en/2633563/observations.rss

This is the returned XML:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" version="2.0">
  <channel>
    <atom:link href="http://open.live.bbc.co.uk/weather/feeds/en/2633563/observations.rss" rel="self" type="application/rss+xml" />
    <title>BBC Weather - Observations for  Worcester, United Kingdom</title>
    <link>http://www.bbc.co.uk/weather/2633563</link>
    <description>Latest observations for Worcester from BBC Weather, including weather, temperature and wind information</description>
    <language>en</language>
    <copyright>Copyright: (C) British Broadcasting Corporation, see http://www.bbc.co.uk/terms/additional_rss.shtml for more details</copyright>
    <pubDate>Fri, 04 Oct 2013 07:14:54 +0100</pubDate>
    <item>
      <title>Friday - 06:00 BST: Light Rain Shower, 17°C (63°F)</title>
      <link>http://www.bbc.co.uk/weather/2633563</link>
      <description>Temperature: 17°C (63°F), Wind Direction: Southerly, Wind Speed: 14mph, Humidity: 88%, Pressure: 1003mb, Falling, Visibility: Good</description>
      <pubDate>Fri, 04 Oct 2013 07:14:54 +0100</pubDate>
      <guid isPermaLink="false">http://www.bbc.co.uk/weather/2633563-2013-10-04T07:14:54.000+01:00</guid>
      <georss:point>52.18935 -2.22001</georss:point>
    </item>
  </channel>
</rss>

Open in new window


I want my website to display something like this:

Thursday - 16:00 BST:
Thick Cloud, 18°C (64°F)

Temperature: 18°C (64°F)
Wind Direction: East South Easterly
Wind Speed: 14mph
Humidity: 89%
Pressure: 1003mb Falling
Visibility: Very Good

How could I do this?

Andy
LVL 3
Andy GreenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Asim NazirCommented:
You can use following for reading xml:

- XML classes in .Net class library. Follow http://support.microsoft.com/kb/307643 for more details.
<link to competing site removed - GaryC123 4th Oct 2013>
0
Carl TawnSystems and Integration DeveloperCommented:
You can retrieve the XML and grab the contents of the two nodes you need using something like:
XmlDocument doc = new XmlDocument();
doc.Load(new XmlTextReader("http://open.live.bbc.co.uk/weather/feeds/en/2633563/observations.rss"));

XmlNode item = doc.SelectSingleNode("rss/channel/item");

string title = item["title"].InnerText;
string description = item["description"].InnerText;

Open in new window

Once you have that, you can parse and display however you want.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andy GreenAuthor Commented:
Thanks for this - just what I needed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.