Python/XML column #36: Should Python and XML Coexist?

"Python and XML: Should Python and XML Coexist?"

In his latest Python and XML column, Uche Ogbuji claims that the costs of using XML as a little language in a Python application may outweigh the benefits of doing so. [Aug. 25, 2005]

In this article I discuss some of the recent round of complaints about XML in the Python community, trying to give perspective that Python and XML should serve very different domains. Treating them in competition for any particular task is often a more general problem of misunderstanding the basic nature of one technology or the other, and it often leads to overstated complaints.

A correspondent already asked one good follow-up question:

My question is simply: do you have a recommendation for an alternative language (or other protocol) that is more suitable for expressing data structures, preferably one that can be coded for reasonably quickly in Python?

YAML seems to be the front-runner for a cross-language data structure format, although JSON is hot these days, courtesy the AJAX hype. I tend to point to Paul Tchistopolskii's, "Alternatives to XML" for a more comprehensive list.

[Uche Ogbuji]

via Copia
2 responses
YAML seems to have gone off into the ether.



It started as a simple human-writable format for expressing more complex structures than just .INI-style key-value pairs. I loved both the idea and its execution when I first came across it.



And then it started acquiring features. Macro-ish structures and multiple docs per file, in-document references, and other things more. Instead of a few simple rules, the spec is now pages upon pages of syntax description. Reading a document that makes use of advanced features is difficult – I’d much rather read an XML document.



Another remark I cannot personally confirm, but which I heard from both a Perl as well as a Python person, is that it has grown too tightly bound to some ways Perl does things, making its proclaimed language agnosticity problematic.



There’s a reason that JSON burst into the scene out of nowhere and took it by storm.
YAML seems to have gone off into the ether.

It started as a simple human-writable format for expressing more complex structures than just .INI-style key-value pairs. I loved both the idea and its execution when I first came across it.

And then it started acquiring features. Macro-ish structures and multiple docs per file, in-document references, and other things more. Instead of a few simple rules, the spec is now pages upon pages of syntax description. Reading a document that makes use of advanced features is difficult – I’d much rather read an XML document.

Another remark I cannot personally confirm, but which I heard from both a Perl as well as a Python person, is that it has grown too tightly bound to some ways Perl does things, making its proclaimed language agnosticity problematic.

There’s a reason that JSON burst into the scene out of nowhere and took it by storm.