XML overuse? (was Re: Python to XML to Python conversion)

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Fri Jul 12 13:45:15 EDT 2002


François Pinard <pinard at iro.umontreal.ca> wrote:
>[Peter Hansen]
>
>> XML was adapted from SGML to meet several key goals.  Among those was
>> the desire to make a format which was easily human-readable and editable
>> using simple tools like text editors.
>
>I do not think so.  SGML already has these virtues, and much more than XML.
>The main goal of XML was to please machines, because full SGML is so
>difficult to parse.  The price to pay to please machines was a loss of
>readability for humans.  XML is so verbose that real information gets
>overwhelmed under tags.  The fish often gets drawn in practice.

Readability for machines does not have to come at the expense of readability
for humans.  A few years back I experimented with an indentation based data
format that is:

- as readable as emacs's outline mode
- reduce to common conventions like this paragraph for simple cases
- allow mixed nested structures of set, sequence, dictionary, and seqdict
- can include binary data 
- can handle different encodings/encryptions in different elements
- with average less than 5% bloat, in contrast to XML's over 100% bloat

Then I learned that there was something called XML which was already (going
to be) wide-spread, and somehow put off my own data format for some later
date.  However, the more I learn about XML, the more I find it badly
designed as a universal data exchange format.

> This being said, XML has been immensely successful, at least in the
>democratic fields, because it is so easier to implement.  Moreover, many
>people consider it is an acceptable compromise between humans and machines.
>But at least compared to SGML, we have to remember that it is a compromise
>away from humans and towards machines, and never turn the argument around.

As with many other inventions in the history, the success of XML is more of
a result of some opportune associations than of a result of its internal
strength.

Huaiyu



More information about the Python-list mailing list