New Posts  All Forums:Forum Nav:

Visual C# XML help

post #1 of 3
Thread Starter 
Hey i'm currently stuck on how to read a XML element.

http://api.openweathermap.org/data/2.5/weather?q=London&mode=xml

How do you get the values inside temperature? value, min, max, unit etc.

thanks
My Computer ...
(11 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom ii x4 955 @4ghz M4A88T-M/USB3 ASUS HD6870 DirectCU 4GB ValueRam 
Hard DriveHard DriveOSMonitor
External 500GB for storage Crucial M4 128GB Windows 7  32* LCD Screen 
KeyboardPowerCase
Logitech G110 CX600 Cooler Master 
  hide details  
Reply
My Computer ...
(11 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom ii x4 955 @4ghz M4A88T-M/USB3 ASUS HD6870 DirectCU 4GB ValueRam 
Hard DriveHard DriveOSMonitor
External 500GB for storage Crucial M4 128GB Windows 7  32* LCD Screen 
KeyboardPowerCase
Logitech G110 CX600 Cooler Master 
  hide details  
Reply
post #2 of 3
Well, there's LINQ to XML. Here's a short tutorial on it.

Just so you can learn stuff, here's the code to get the value:
Code:
XDocument xdoc = XDocument.Load(); //get the value, it's empty as you may have the file saved or maybe you want to download it, doesn't matter
int value = int.Parse(xdoc.Root.Element("temperature").Attribute("value").Value);
post #3 of 3
Thread Starter 
Thanks!
My Computer ...
(11 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom ii x4 955 @4ghz M4A88T-M/USB3 ASUS HD6870 DirectCU 4GB ValueRam 
Hard DriveHard DriveOSMonitor
External 500GB for storage Crucial M4 128GB Windows 7  32* LCD Screen 
KeyboardPowerCase
Logitech G110 CX600 Cooler Master 
  hide details  
Reply
My Computer ...
(11 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom ii x4 955 @4ghz M4A88T-M/USB3 ASUS HD6870 DirectCU 4GB ValueRam 
Hard DriveHard DriveOSMonitor
External 500GB for storage Crucial M4 128GB Windows 7  32* LCD Screen 
KeyboardPowerCase
Logitech G110 CX600 Cooler Master 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming