Rana.S
Rana.S

Reputation: 2275

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.

Upvotes: 0

Views: 629

Answers (2)

Plamen Nikolov
Plamen Nikolov

Reputation: 4187

You can pass data from the web service to the application using JSON format. And then you can use JSON parser

Upvotes: 0

Vincent Mimoun-Prat
Vincent Mimoun-Prat

Reputation: 28541

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.

Upvotes: 3

Related Questions