I cant get the Parser_StartElement event to process. Any Ideas?
I have tried the examples.
I have tried the examples.
B4X:
Sub Process_Globals
Dim Parser As SaxParser
Dim PID As String
End Sub
Sub LoadXMLFile (FileName As String)
Parser.Initialize
ProcessRead(FileName)
End Sub
Sub ProcessRead(FileName As String)
Dim In As InputStream
Dim FileToProcess As String
FileToProcess=File.DirRootExternal & "/" & FileName
If File.Exists (File.DirRootExternal, FileName) Then
In = File.OpenInput(File.DirRootExternal, FileName)
Parser.Parse(In, "Parser")
In.Close
Else
ToastMessageShow(FileToProcess & " DOES NOT EXIST", True)
End If
End Sub
Sub Parser_StartElement (Uri As String, Name As String, Attributes As Attributes)
Dim mSample As Map
Dim AttrName As String
If Name.ToUpperCase="segment".ToUpperCase Then
PID = Attributes.GetValue2("","PID")
Log(PID)
End If
End Sub