XML Considered Harmful

Pete Forman petef4+usenet at gmail.com
Wed Sep 22 03:56:48 EDT 2021


Jon Ribbens <jon+usenet at unequivocal.eu> writes:

> On 2021-09-21, Pete Forman <petef4+usenet at gmail.com> wrote:
>> CSV is quite good as a lowest common denominator exchange format. I
>> say quite because I would characterize it by 8 attributes and you
>> need to pick a dialect such as MS Excel which sets out what those
>> are. XML and JSON are controlled much better. You can easily verify
>> that you conform to those and guarantee that *any* conformant parser
>> can read your content. XML is more powerful in that repect than JSON
>> in that you can define and enforce schemas. In your case the fuel
>> name, UOM, etc. can be validated with standard tools. In JSON all
>> that checking is entirely handled by the consuming program(s).
>
> That's not true. You can use "JSON Schema" to create a schema for
> validating JSON files, and there appear to be at least four
> implementations in Python.

Fair point. It has been a while since I looked at JSON schemas and they
were rather less mature then.

-- 
Pete Forman


More information about the Python-list mailing list