XML

François Pinard pinard at iro.umontreal.ca
Fri Jul 16 05:04:02 CEST 2004


[Fredrik Lundh]

> the elementtree API is really minimal; you can easily create an
> elementtree-style binding for almost any hierarchial data structure in
> a couple of hours.

Yes, I foresee this as an interesting and tempting avenue. `elementtree'
could be pondered as a simple framework even for non-XML applications.
I would never be tempted to use the DOM paradigm outside XML processing.

> You'll always pay a penalty when you need to convert from a non-
> Python representation to a Python representation.

As all Python XML processing tools use Python representations, more or
less, I guess you meant representations which are more Python-natural.

Part of the penalty which I observed in my previous XML programs is the
necessary cleanup of textual elements, especially those which the XML
original writer meant for pretty-printing the XML, but which have no
value in themselves.  We do not want stumbling on them all the time.
As `elementtree' is really all centred over the tree of XML elements,
pushing character data into `.text' and `.tail' attributes, the cleanup
is a bit less necessary and probably often avoidable.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard



More information about the Python-list mailing list