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

后端 未结 23 618
轻奢々
轻奢々 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 09:39

    Straight from the horse's mouth, the design goals of XML were:

    1. XML shall be straightforwardly usable over the Internet.
    2. XML shall support a wide variety of applications.
    3. XML shall be compatible with SGML.
    4. It shall be easy to write programs which process XML documents.
    5. The number of optional features in XML is to be kept to the absolute minimum, ideally zero.
    6. XML documents should be human-legible and reasonably clear.
    7. The XML design should be prepared quickly.
    8. The design of XML shall be formal and concise.
    9. XML documents shall be easy to create.
    10. Terseness in XML markup is of minimal importance.

    The reason why it became popular was because people needed a standard for a cross-platform data exchange format. XML may be a bit bloated, but it is a very simple way to delimit text data and it was backwards compatible with the large body of existing SGML systems.

    You really can't compare XML to CSV because CSV is an extremely limited way of representing data. CSV cannot handle anything outside of a basic row-column table and has no notion of hierarchy.

    XML is not that hard to parse and once you write or find a decent XML utility it's not difficult to deal with in code either.

提交回复
热议问题