jsonxmlcsvsoapdata-transfer

Why is XML still used?


I was going through data transmission and was wondering why XML is still in use?

Every source puts JSON and even CSV data format over XML, but from practice I can say that XML is still popular. Only reason that comes to mind is SOAP and its WS-security, which allows only XML. But even though every REST API prefers JSON, XML can still can be used.


Solution

  • Because XML is a better fit for documents than JSON or CSV.

    Current use of XML for data (as opposed to documents) is a relic from an earlier era when XML's use had been over-extended beyond its natural fit as a representation for documents.

    Here are some useful current heuristics to guide your choice between CSV, XML, and JSON:

    Choose CSV if

    Choose XML if

    Choose JSON if