amk at amk.ca
Mon Jun 23 19:18:49 CEST 2003
On Mon, 23 Jun 2003 20:49:16 +0400 (MSD),
Roman Suzi <rnd at onego.ru> wrote:
> On Mon, 23 Jun 2003, Alan Kennedy wrote:
> has some proprietary format. For example, I can easily write:
> zoo = "la\"lala"
> In case of XML I will need something like
On the other hand, the XML format is readily useful for nested trees of
objects. You could imagine writing bookmarks = http://url1,http://url2,...
but if you want to support folders containing URLs, the format and the
resulting parser would get messy (unless you throw the complexity over the
wall into the Python interpreter and just use eval()).
> - not a big deal, but it's harder to parse. And also XML software keeps
> changing (or so it seems), and this gives a sense of instability.
I've come to the conclusion that the initial concern for supporting APIs
such as SAX and DOM in Python was a mistake; many bugs stem from trying to
support interfaces that don't map to Python very well. Instead we should
have made nice Pythonic interfaces such as effbot's ElementTree which are
simpler to implement and to use, and ignore the W3C's APIs. SAX isn't too
bad in this respect -- pull APIs look pretty similar, differing only in
interface and method names -- but the DOM has been a mess, spawning several
implementations all of which are fairly complex.
 SAX is a _de facto_ API, not a W3C one; perhaps that explains why it's
not too bad.
More information about the Python-list