Sub Globals
Dim ListView1 As ListView
Dim TempName,TempAllCoords,TempCoords As String
Dim TempAllList,SafeList As List
Dim NameCount As Int
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("Document") > -1 Then
If Name="SimpleData" Then
If NameCount=0 Then
TempName=Text.ToString
End If
If NameCount=7 Then
TempName=TempName&"_"&Text.ToString
End If
NameCount=NameCount+1
End If
If Name = "coordinates" Then
SafeList.Initialize
TempAllCoords=Text.ToString
TempCoords=TempAllCoords.Replace("0 ","")
TempAllList.Initialize
TempAllList=Regex.Split(",",TempCoords)
For i=0 To TempAllList.Size/2 Step 2
Dim ln As LatLng
ln.Initialize(TempAllList.Get(i+1),TempAllList.Get(i))
SafeList.Add(ln.Latitude&","&ln.Longitude&",")
Next
File.WriteList(File.DirRootExternal& "/Grenzen",TempName&".txt",SafeList)
ListView1.AddSingleLine(TempName)
NameCount=0
End If
End If
End Sub