XML vs JSON Vs Self parsing

I have not really used, and don’t know a lot about either of these, BUT I need to pull info from a web service that can return data in either format.

I need to pull out about 8-10 pieces of information. Looking at the text I returned it looks like some of them are buried very deeply in the hierarchy. I need to get the is done ASAP…

I would appreciate recommendations on which way would be best and why.

Thanks

  • karen

(PS: I know I REALLY should learn more about web technologies… but this project came out of the blue and I need to get it done asap )

Json is easier to deal with and the new framework will parse it right into a dictionary for you.

+1 for JSON

I’m not very familiar with Xojo’s JSON capabilities, but with XML you can do XQL queries and get to the data quickly regardless of how deep it is buried, without having to walk the hierarchy or even having to know the hierarchy.

Thanks all.

It turns out I need to use 2 web services in this app and the second ONLY outputs in XML, so that is what I am going with so I don’t have to fuss with both XML and JSON right now.

I got code working that seems to pull teh info I need… Not site how robust the way I did it is, but it will do for now as I don;t have time to do more.

Tim, the way this XML is set up, I could not figure out a simple way to get a single type of data that I needed with an XQL query… So I used the staring list of nodes form XQL, iterated over them for the right property and then navigated from there by position… which is why I am not sure how robust that is for the long run, but as I said it will do for now.

  • karen