3

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

Community
  • 1
  • 1
biox
  • 1,526
  • 5
  • 17
  • 28

1 Answers1

5

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

HansBKK
  • 66
  • 1