Using Json Parser for parsing xml type webservices
I have come to know that Json parser is fast over DOM & SAX parser. I also get information that Json parsing using for well formated Javascript type document.
My question is there . Can we parse xml format Web Services using Json Parsing ?
If yes please suggest me some good example sources for this. Thanks开发者_Python百科.
No, JSON is a format, just like XML. A JSON document could look like:
{
success: true,
result: ['item1', 'item2']
}
A corresponding XML could be describer as:
<return>
<success>true</success>
<result>
<item>item1</item>
<item>item2</item>
</result>
</return>
You should read the Wikipedia article to understand what JSON is and when to prefer using it in place of XML. Both have advantages and disadvantages.
You can pass data from the web service to the application using JSON format. And then you can use JSON parser
精彩评论