Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("DVD") > -1 Then
If Name = "Title" Then
Title = Text.ToString
Else If Name = "Released" Then
Link = Text.ToString
Else If Name = "RunningTime" Then
pubDate = Text.ToString
End If
End If
If Name = "DVD" Then
ListView1.AddSingleLine2(Title, Link) 'add the title as the text and the link as the value
End If
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("DVD") > -1 Then
If Name = "Title" Then
Title = Text.ToString
Else If Name = "Released" Then
Link = Text.ToString
Else If Name = "RunningTime" Then
pubDate = Text.ToString
End If
End If
If Name = "DVD" AND parser.Parents.IndexOf("DVD") = -1 Then
ListView1.AddSingleLine2(Title, Link) 'add the title as the text and the link as the value
End If
End Sub
Sub find_Bars(lat,lon As String)
Dim request As HttpRequest
URL = "http://local.yahooapis.com/LocalSearchService/V3/localSearch?appid=YahooDemo"
request.InitializeGet(URL & "&query=bar" & "&results=20" & "&radius=10" & "&latitude=42.53" & "&longitude=-83.73")
request.Timeout = 10000
If HttpClient1.Execute(request, 1) = False Then Return
End Sub
Sub HttpClient1_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim result As InputStream
result = Response.GetInputStream
parser.Parse(result, "Parser")
End Sub
'Sub HttpClient1_ResponseSuccess (Response As HttpResponse, TaskId As Int)
'Dim result As String
'result = Response.getstring("UTF8")
'Log(result)
'End Sub
<result>
<rep name="Brad Sherman" party="D" state="CA" district="27" phone="202-225-5911" office="2242 Rayburn House Office Building" link="http://bradsherman.house.gov/"/>
<rep name="Howard Berman" party="D" state="CA" district="28" phone="202-225-4695" office="2221 Rayburn House Office Building" link="http://www.house.gov/berman/"/>
<rep name="Barbara Boxer" party="D" state="CA" district="Junior Seat" phone="202-224-3553" office="112 Hart Senate Office Building" link="http://boxer.senate.gov"/>
<rep name="Dianne Feinstein" party="D" state="CA" district="Senior Seat" phone="202-224-3841" office="331 Hart Senate Office Building" link="http://feinstein.senate.gov"/>
</result>
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
Dim replistview1 As List
replistview1.Initialize
If parser.Parents.IndexOf("result") > -1 Then
If Name = "rep" Then
repname = Text.ToString
End If
End If
If Name = "result" Then
ToastMessageShow(repname, True)
End If
End Sub