• Alex Gay (5/3/2012)


    XML is a solution looking for a problem. The big mistake is thinking that data interchange is the problem. I have a data file to send that has two formats available, csv and xml, one is quick and easy to write, export and import as the format and schema are well documented and produces a file of about 4MB. The other is slow to produce, difficult to code and the schema is hard to understand, it is also slow to import and produces a file of about 22MB. You've guessed it the first is a CSV and the second is XML.

    Data exchanges do not need to be human readable, they need to be machine readable, and for that small and fast are key, even EDIFACT is better than XML.

    This doesn't mean I haven't learnt it, one day it will find the problem it is looking to be a solution to.

    I think you are missing other real life requirements:

    * Seamless extensibility (without needing rewrites of consuming processes)

    * Serving multiple audiences with one XML stream instead of having to tailor for each and every consuming party

    Data exchage between N:M party relationships is common and favors XML. And I found coding "adaptors" to import various data streams more error prone in CSV then for XML (I have to do both often). Granted, processing simple streams of simple types is faster in CSV, but when you have more complex data to convey (data with hierarchical structure), XML easily wins in the speed, compactness and ease/speed of processing and coding.

    There is one real problem I experience with XML …. is people! Many people producing code that generates XML have no clue what they are doing, but it is that easy to produce! They are unable to model their data properly and often do not handle escaping well, causing errors in individual elements. But XML escaping is extremely simple and requires only a few find/replace actions you can do in practically every programming environment. It is truly a lack of basic knowledge that is the culprit here. I developed a toolset to work around the encoding issue by dropping those specific objects of interest that have these errors and keep processing the rest of the document.

    So, the author of the article is correct….learn it, XML in its basic form is very easy to understand and not all that hard to navigate. And if you want to see a nicely formatted readably XML document for debugging purposes, just open it with Internet Explorer (provided the file is not humongous).