Before XML became a standard and given all its shortcomings, what made XML so popular?

后端 未结 23 616
轻奢々
轻奢々 2021-02-04 09:01

Yes XML is human readable but so is comma delimited text and properties files.

XML is bloated, hard to parse, hard to modify in code, plus a ton of other problems that I

23条回答
  •  别那么骄傲
    2021-02-04 09:42

    • You can be given an xml file and have a chance at understanding what the data means by reading it without needing a separate specification of your pre-xml data format.
    • Tools can be used to work with xml generically. Where before, if everybody used different file formats: comma separated, binary, etc. You'd need to write a custom tool.
    • You can extend it, by adding a new tag into the schema with a default value. And if done correctly, with xml that doesn't break all the old code that parses the xml but doesn't know about the tag. That usually isn't true with proprietry formats.
    • Probably the main thing that makes it popular is it looks a bit like HTML, which lots of people understood previously. So it became popular, then because it was popular it became more popular because its nice to work with one standard that everybody knows.
    • A bad thing is that xml is usually a lot bigger because of all the tags and because its text based than used to be used. But, as computers are bigger now, we can often handle that and its worth trading size for having better self-describing data.
    • You can get off the shelf code/libraries that will parse/write xml.

提交回复
热议问题