hey all,
I have this lovely feed from weather.com and i can read the information in vb and output it with afew problems..
when i ask for the content of 't' (meaning cc.t) it reads through the document and outputs the last 't' (meaning cc.moon.t).
I know this seems abit vauge.. but i cant really be anymore specific at this time..
how would i select the correct node and read its value? cause at the moment i am using case to select 't' and i know that there is a better way....
Wether.com XML feed:
CODE
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--This document is intended only for use by authorized licensees of The Weather Channel. Unauthorized use is prohibited. Copyright 1995-2004, The Weather Channel Enterprises, Inc. All Rights Reserved.-->
<weather ver="2.0">
<head>
<locale>en_US</locale>
<form>MEDIUM</form>
<ut>C</ut>
<ud>km</ud>
<us>km/h</us>
<up>mb</up>
<ur>mm</ur>
</head>
<loc id="UKXX0092">
<dnam>Manchester, United Kingdom</dnam>
<tm>11:02 AM</tm>
<lat>53.37</lat>
<lon>-2.26</lon>
<sunr>5:18 AM</sunr>
<suns>8:54 PM</suns>
<zone>1</zone>
</loc>
<cc>
<lsup>5/10/05 10:20 AM Local Time</lsup>
<obst>Manchester, United Kingdom</obst>
<tmp>10</tmp>
<flik>8</flik>
<t>Partly Cloudy</t>
<icon>30</icon>
<bar>
<r>1,023.0</r>
<d>steady</d>
</bar>
<wind>
<s>14</s>
<gust>N/A</gust>
<d>350</d>
<t>N</t>
</wind>
<hmid>58</hmid>
<vis>10.0</vis>
<uv>
<i>3</i>
<t>Moderate</t>
</uv>
<dewp>2</dewp>
<moon>
<icon>1</icon>
<t>Waxing Crescent</t>
</moon>
</cc>
</weather>
VB code:
CODE
While myReader.Read()
If myReader.NodeType = XmlNodeType.Element Then
Select Case myReader.Name
Case "t"
Me.description = myReader.ReadElementString
end select
end if
end while
Any help would be amazing.