Search code examples
xmlcsvdata-formats

When and Why is XML preferable to CSV?


sometimes it feels like XML has been used just because it was fashionable.


Solution

  • Some strengths:

    • You can validate XML data against XSD
    • You can easily provide contracts (as XSD) to other parties that should either create/consume XML data, without literally describing them
    • You can have one to many relations in multi-levels in XML data representation
    • XML is arguably more readable than CSV
    • XML is natively supported by the .net framework

    To name a few from the top of my head.