aspose file tools*
The moose likes Java in General and the fly likes JSON vs XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JSON vs XML" Watch "JSON vs XML" New topic
Author

JSON vs XML

Anu Bhagat
Ranch Hand

Joined: Jun 20, 2008
Posts: 64
I am trying to make a decision for data transfer appraoch in a java application.
I am not sure if I should use JSON or XML.
Any comments will be useful.

Thanks in advance.

Anu Bhagat


SCJP5.0, SCJA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
"In" a Java application? What are the two ends of the transfer?


Ping & DNS - updated with new look and Ping home screen widget
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

I think this might help you

Vishal


Programming is about thinking, NOT coding
kourosh parsa
Ranch Hand

Joined: Jan 22, 2012
Posts: 35
    
    1
xml has a definition file which can be used to validate that your tags are correct.
Both the formats are well supported for parsing so I guess you can go with which ever, although in the industry, xml is often favored.
Marcos Vidolin
Greenhorn

Joined: May 10, 2011
Posts: 28
The approach will depend on what you want. In general I have used JSON because it's smaller and more readable than XML.
Just for note, Twitter and Foursquare left XML and started using exclusively JSON.

The following code snippets represents the same data:


JSON


XML
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSON vs XML
 
Similar Threads
How to do Stress and performance testing for Webservices API
REST returnin XML insted of JSON
CXF: JSON and XML response based on Content-Type
How to return an object instance by JSP