walterf25 Expert Licensed User Longtime User Mar 10, 2012 #1 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 Code: 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
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 Code: 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
NJDude Expert Licensed User Longtime User Mar 10, 2012 #2 What's the link to that XML?, I can help you if you give a clue. Upvote 0
walterf25 Expert Licensed User Longtime User Mar 10, 2012 #3 Thanks NJDUde NJDude said: What's the link to that XML?, I can help you if you give a clue. Click to expand... this is the link http://api.metro.net/agencies/lametro/routes/xml/ i just upgraded the HTTP library to version 1.2 but now i can't use the method posted above. do you know why this is? Last edited: Mar 10, 2012 Upvote 0
Thanks NJDUde NJDude said: What's the link to that XML?, I can help you if you give a clue. Click to expand... this is the link http://api.metro.net/agencies/lametro/routes/xml/ i just upgraded the HTTP library to version 1.2 but now i can't use the method posted above. do you know why this is?
NJDude Expert Licensed User Longtime User Mar 10, 2012 #4 Ok, take a look at the attached project. Attachments GenericXMLParserSample.zip GenericXMLParserSample.zip 6.9 KB · Views: 509 Upvote 0
walterf25 Expert Licensed User Longtime User Mar 10, 2012 #5 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
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:
walterf25 Expert Licensed User Longtime User Mar 10, 2012 #6 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 Code: Sub Parser_EndElement(Uri As String, Name As String, Text As StringBuilder) and Code: Sub Parser_StartElement(Uri As String, Name As String, Text As StringBuilder) is, how do i know when to use either one? Upvote 0
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 Code: Sub Parser_EndElement(Uri As String, Name As String, Text As StringBuilder) and Code: Sub Parser_StartElement(Uri As String, Name As String, Text As StringBuilder) is, how do i know when to use either one?
NJDude Expert Licensed User Longtime User Mar 10, 2012 #7 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
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.
walterf25 Expert Licensed User Longtime User Mar 13, 2012 #8 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
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