Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xml, yaml and json [duplicate]

Tags:

json

xml

yaml

Possible Duplicate:
XML vs YAML vs JSON

I read a lot of things about xml, yaml and json and I know that each one is better in some cases than other. I just want to ensure that what i have in my mind is right...

json can be converted to yaml and xml

yaml can be converted to xml, and not always to json I read it from here: "Technically YAML is a superset of JSON. This means that, in theory at least, a YAML parser can understand JSON, but not necessarily the other way around." read here

xml cannot be converted always to yaml and json

like image 877
biox Avatar asked Feb 20 '26 11:02

biox


1 Answers

Yes, since XML is a bit "more-ish" than yaml, for example name-space support, it would be possible to construct examples of the former that would be at least difficult to represent completely in the latter.

And my understanding is that yaml was iterated to v1.2 specifically to become a superset of json, so what you say is true by definition.

If your point is in deciding which to use, my advice is to use the easiest and simplest for your immediate needs, and only go "upstream" in complexity (json --> yaml --> xml) if you really need to.

Unless your language of choice or other technical aspects of your use case already have robust support for the more complex choice, in which case it becomes the simpler to implement.

KISS

like image 125
HansBKK Avatar answered Feb 23 '26 00:02

HansBKK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!