I am calling from an XML using XOM but i would like to add the postcode/town/county attributes to a multiple array or list, perhaps before Spinner1.add(ListTitle) ??
Can anyone help me with a global array???
Can anyone help me with a global array???
B4X:
<postc>
<postcode>AB10</postcode>
<town>Aberdeen</town>
<county>Aberdeen</county>
</postc>
B4X:
Sub XOMBuilder1_BuildDone(XOMDocument1 As XOMDocument, Tag As Object)
If XOMDocument1=Null Then
' XOMDocument1 will be Null if an error has occurred
Log("An error has occured and the XOMDocument has NOT been created")
' now handle the failure to get and parse the XML
Else
Log("XOMDocument successfully created")
Dim RootElement As XOMElement=XOMDocument1.RootElement ' this will be the <datas> element/tag
Dim CompElement As XOMElement=RootElement.GetFirstChildElementByName("result")
Dim ResultElements As XOMElements=CompElement.GetChildElementsByName("postc")
BuildSpinner
End If
End Sub
Sub BuildSpinner
Dim i As Int
Dim ListTitle As String
Dim ResultElement As XOMElement
For i=0 To ResultElements.Size-1
ResultElement=ResultElements.GetElement(i)
ListTitle=ResultElement.GetFirstChildElementByName("postcode").value
Spinner1.add(ListTitle)
Next
End Sub