XML parsing with new HTTP library

walterf25

Expert
Licensed User
Longtime User
Hello everyone, i'm a little confused with the new HTTP ibrary, i'm using it to retrieve a list of bus schedules which of course are returned in an xml format, i'm trying to figure out how to do this using the xmlsax library, can anyone here please help me maybe by posting an example on how i would begin doing this, i see that the new HTTP library is a bit different than the previous one, for some reason this doesn't work anymore
B4X:
Sub HttpClient1_Responsesuccess (Response As HttpResponse, TaskId As Int)
Dim in as string
in = Response.GetString("UTF8")
End sub
can anyone help me with this please.

Thanks,
walter
 

walterf25

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Thanks

Awesome, that is exactly what i need, wow thank you so so so so very much NJDude, if i could i would give you a big hug and a big kiss, lol
thanks a lot buddy, this will get me started.

cheers,
Walter
:sign0098:
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Sub Parser_EndElement(Uri As String, Name As String, Text As StringBuilder)

Hi NJDude, thanks again for your help, i need to know what the difference between
B4X:
Sub Parser_EndElement(Uri As String, Name As String, Text As StringBuilder)
and
B4X:
Sub Parser_StartElement(Uri As String, Name As String, Text As StringBuilder)
is, how do i know when to use either one?
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
The StartElement and EndElement are parts of an XML (you can read more HERE), how to use those depends on the XML itself, I don't know how to explain this but if you look at the XML you provided and a XML generated by an RSS the way to parse them will be different, in this case I used the StartElement because I could extract the info directly, in the case of an RSS you will have to use the EndElement, sometimes is trial and error; honestly, I just "know" how to use the XML Parser but can't quite explain the process, but it's simple, just try and see which parts gives you the necessary results.

Sorry if I'm not clear enough.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Thanks NJDUde

Hey NJDude, is it ok if i PM you, i need to ask for your help but i can't post the question on here, i'm afraid that someone else may still my idea, please let me know if it's ok

thanks,
Walter
 
Upvote 0
Top