'Libraries required...
' Core, Http, StringUtils,XmlSax
' Additional Modules
' HttpJob, HttpUtils2Service
Sub Process_Globals
'-----------------------------
Dim WebSearch As HttpJob
'-----------------------------
Dim parser As SaxParser
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim SiteToRead = "http://www.bishmedia.co.uk/default/Apps/xmldata.xml"
Dim BandList As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebSearch.Initialize("WebSearch",Me)
BandList.Initialize
parser.Initialize
WebSearch.Download(SiteToRead)
End Sub
Sub DisplayList
Dim ListLength As Int
Dim resp As Int
'-------------------------------------
ListLength = BandList.Size-1
If ListLength > 0 Then
For cntr = 0 To ListLength
Log("BandName = " & BandList.Get(cntr))
Next
End If
resp = InputList(BandList,"Pick a band",-1)
End Sub
Public Sub JobDone (Job As HttpJob)
'-----------------------------
Dim j As InputStream
Dim res As Map
'-----------------------------
res.Initialize
If Job.Success = True Then
j = Job.GetInputStream
parser.Parse(j, "parser")
DisplayList
End If
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
'-----------------------------
Dim cnt As Int
Dim bandname As String
'-----------------------------
If parser.parents.IndexOf("comp") > -1 Then
If Name = "bandName" Then
bandname = Text.ToString
BandList.Add(bandname)
End If
End If
End Sub