Hacker News new | ask | show | jobs
by Jesse_Ray 5219 days ago
XML may seem harder than JSON, until you actually try to work with the data. When you need to create an automated system that checks that data has a certain format, XML has support for schemas and there are many software tools for creating schemas, which is something that cannot be said of JSON. Likewise, searching for data is much easier when you have a standard like XPath. Something akin to XPath would be much harder to make for JSON, since it lacks native support for element attributes. When the data needs to be transformed into a variety of formats, XSLT comes to the rescue. When you want to give the user data in a readable way, JSON requires server-side processing whereas XML and CSS (and sometimes XSLT) support is built into the web browser. In my opinion, JSON gets too much attention for what little it offers. It could become a serious alternative to XML in the distant future, but not until it has the kind of technological environment that XML enjoys.
1 comments

* In my opinion, JSON gets too much attention for what little it offers. It could become a serious alternative to XML in the distant future, but not until it has the kind of technological environment that XML enjoys.*

JSON has smoked XML in the RPC/SOAP etc style uses. Including replacing the X (for XML) in AJAX.

It is also the preferred format for many datastores.

It does not have mature tools like the ones you describe, e.g for schema validation, transformation, etc. Then again, lots of people have found that in regards to XML, the aren't gonna need them, anyway.

For other uses, still, XML is king.

Thanks for the information, batista. It does not surprise me to hear that JSON has gotten popular in Javascript applications and the datastores that interact with them, and likewise with key-value datastores since the data mapping seems rather straight-forward when compared with XML (element attributes would seem to pose some problems). However, it would pique my interest to hear that other kinds of datastores prefer it. Do you have any links handy that show this about other data-stores and the technical reasons behind the preference? And at the risk of requesting too much, any links that show JSON besting XML in many RPC/SOAP use-cases?