Hi All,
While parsing xml using the SAX library, for some reason the events are not being fired, at least the end event isn't as that's the one I'm interested in.
The frustrating thing is that this was working last night. What I did change was to use multiple Parser objects in the same code module, each using a different event name. This was necessary because the first API call results in a SessionID, I use that session id to build a URL, then after the user is done with the auth in a webview, the app uses the API to get an access token and so on. I know I could have perhaps done it all with one parser object but thought my code would be cleaner. But now even if I remove all the code and just have a session id code as below with only one Parser object present in the code module, it still doesn't trigger the events.
Has anyone got an idea as to why this might be happening?
While parsing xml using the SAX library, for some reason the events are not being fired, at least the end event isn't as that's the one I'm interested in.
The frustrating thing is that this was working last night. What I did change was to use multiple Parser objects in the same code module, each using a different event name. This was necessary because the first API call results in a SessionID, I use that session id to build a URL, then after the user is done with the auth in a webview, the app uses the API to get an access token and so on. I know I could have perhaps done it all with one parser object but thought my code would be cleaner. But now even if I remove all the code and just have a session id code as below with only one Parser object present in the code module, it still doesn't trigger the events.
Has anyone got an idea as to why this might be happening?
B4X:
Sub ParseSessionId(ResponseXML As InputStream)
Dim parser1 As SaxParser
parser1.Initialize
parser1.Parse(ResponseXML,"Parser")
End Sub
Sub Parser_StartElement (Uri As String, Name As String, Attributes As Attributes)
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If Not(RequestSuccessful) Then
Return
End If
If Name = "Ack" Then
If Text.ToString <> "Success" Then
RequestSuccessful = False
End If
Else If Name="SessionID" Then
SessionId = Text
Log("SessionID = " & SessionId)
End If
End Sub