it seems like json can do everything xml can and is more human-readable. so why do applications still save in xml instead of json? http://www.json.org/xml.html
this suggests that xml is useful for xml schemas, xquery/xpath and xslt, which json has not implemented. I found further discussion on those below:
http://en.wikipedia.org/wiki/JSON#Schema_and_Metadata
http://stackoverflow.com/questions/8481 ... uery-xpath
http://stackoverflow.com/questions/1618 ... t-for-json
It seems like XML would be preferable for markup of documents or in data transmission. But LAU applications don't do either of these, so why are they always saved in XML?
why do applications save in xml instead of json?
Moderators: MattKingUSA, khz
- raboof
- Established Member
- Posts: 1855
- Joined: Tue Apr 08, 2008 11:58 am
- Location: Deventer, NL
- Has thanked: 50 times
- Been thanked: 74 times
- Contact:
Re: why do applications save in xml instead of json?
The FSF agrees: https://www.gnu.org/licenses/license-list.html#JSONfalkTX wrote:I deserve the right to do evil things!
I doubt that is the reason projects stick with XML though .
The argument that JSON is more human-readable isn't really all that relevant, as save-files are not typically suitable to be read by humans anyway. It's interesting to note that when XML was introduced, one of its features was that it was much more human-readable than the formats popular at the time .
XML typically adds some complexity (schema's, namespacing etc), but you do get something in return: you can generate code or validate input based on schema's, and be more confident that you'll be able to handle whatever is thrown at you, as long as it adheres to the contract. With namespacing, you can re-use concepts across different file types, design intricate extension mechanisms.
The fact that JSON doesn't have those 'heavy' features (though some people are trying to add them ) is actually one of the main advantages of JSON.
It's pretty much impossible to decide which approach is 'better', it's much like the 'static types' discussion: both approaches have their advantages.
-
- Established Member
- Posts: 2347
- Joined: Mon Jul 01, 2013 8:13 am
- Has thanked: 9 times
- Been thanked: 466 times
Re: why do applications save in xml instead of json?
guitarix use the json format to save/load presets.
To avoid any license conflict, we've written our own parser.
To avoid any license conflict, we've written our own parser.
On the road again.