Hello everybody,
I've been up all night trying to figure out how to parse just one day of data from the following link, lets say Wed(for Wednesday).
http://www.google.com/ig/api?weather=birmingham,uk
I used as much information from post47454 as possible and I even looked at post39737.
I just can't seem to get the correct data from the XML feed.
I can get the xml using HttpUtils and save it onto the device just fine, I just need to filter the following information. I can also read the day, not not the following information for that day.
<day_of_week data="Wed"/>
<low data="52"/>
<high data="64"/>
<icon data="/ig/images/weather/chance_of_storm.gif"/>
<condition data="Chance of Storm"/>
This is correct:
Sub xml_StartElement(Uri As String, Name As String, Attributes As Attributes)
If Name = "day_of_week" AND parser.Parents.IndexOf("forecast_conditions") > -1 Then
If Attributes.GetValue2("", "data") = "Wed" Then
Log("Yes day correct")
currentName = Attributes.GetValue2("", "data")
End If
End If
End Sub
But this is not:
Sub xml_EndElement(Uri As String, Name As String, Text As StringBuilder)
Dim Low, High, Icon, Condition As String
If Name = "day_of_week" AND parser.Parents.IndexOf("forecast_conditions") > -1 Then
Select currentName
Case "low"
Log("Low: " & Text.ToString)
Case "high"
Log("High: " & Text.ToString)
Case "icon"
Log("Icon: " & Text.ToString)
Case "condition"
Log("Condition: " & Text.ToString)
End Select
End If
End Sub
I've been looking all over the forums for hours just for the fix and I've now got an headache
Any help or code rewrites would be very helpful.
Thanks in advanced.
I've been up all night trying to figure out how to parse just one day of data from the following link, lets say Wed(for Wednesday).
http://www.google.com/ig/api?weather=birmingham,uk
I used as much information from post47454 as possible and I even looked at post39737.
I just can't seem to get the correct data from the XML feed.
I can get the xml using HttpUtils and save it onto the device just fine, I just need to filter the following information. I can also read the day, not not the following information for that day.
<day_of_week data="Wed"/>
<low data="52"/>
<high data="64"/>
<icon data="/ig/images/weather/chance_of_storm.gif"/>
<condition data="Chance of Storm"/>
This is correct:
Sub xml_StartElement(Uri As String, Name As String, Attributes As Attributes)
If Name = "day_of_week" AND parser.Parents.IndexOf("forecast_conditions") > -1 Then
If Attributes.GetValue2("", "data") = "Wed" Then
Log("Yes day correct")
currentName = Attributes.GetValue2("", "data")
End If
End If
End Sub
But this is not:
Sub xml_EndElement(Uri As String, Name As String, Text As StringBuilder)
Dim Low, High, Icon, Condition As String
If Name = "day_of_week" AND parser.Parents.IndexOf("forecast_conditions") > -1 Then
Select currentName
Case "low"
Log("Low: " & Text.ToString)
Case "high"
Log("High: " & Text.ToString)
Case "icon"
Log("Icon: " & Text.ToString)
Case "condition"
Log("Condition: " & Text.ToString)
End Select
End If
End Sub
I've been looking all over the forums for hours just for the fix and I've now got an headache
Any help or code rewrites would be very helpful.
Thanks in advanced.