File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes JSON vs XML Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 35249
    
    7
"In" a Java application? What are the two ends of the transfer?


Android appsImageJ pluginsJava web charts
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
Greenhorn

Joined: Jan 22, 2012
Posts: 19
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: 25
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JSON vs XML
 
Similar Threads
CXF: JSON and XML response based on Content-Type
REST returnin XML insted of JSON
How to do Stress and performance testing for Webservices API
How to return an object instance by JSP