简体   繁体   中英

How To parse XML and JSON data in single Response in Android

Can Any one help me to parse XML and JSON data response in Android. From my web service i got following type of response. i am bit confused as to how can i parse this data . Due to low reputation i can't upload image of response. help me to parse in android. here is link of response

It looks like that's just XML wrapping JSON. So parse it as XML, then take the text content of the root element (the only element present) and then parse that as JSON.

Basically, just do one thing at a time and you'll be fine: treat the XML as "just XML" where you want the text content, and treat the JSON as "just JSON" - it's irrelevant that it was previously wrapped in XML.

(You might also want to see if there's anything you can do to make the web service just return plain JSON. There's no reason to wrap it in XML like this...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM