Resolution for now (Re: ElementTree vs. lxml (python XML libraries))

John (J5) Palmieri johnp at redhat.com
Thu May 12 21:20:05 UTC 2005


After talking to a bunch of people and reading the responses here is my
take on things:

* I have made the decision for right now to go with the libxml2 bindings
or perhaps put the parsing in the C layer and use libxml2 directly.  The
reason for this is simple - most all distros have libxml2 and in the end
dbus just needs a fast parser that everyone uses.  

* The original thought was to make lxml the default if it was ready and
a drop in replacement for yum (there really should be one defacto way to
parse XML documents in Python or at least one clear winner).  This
however is not true yet though it may be in the future so I am going to
go ahead and package lxml for extras during the FC5 cycle and start
playing with it, offering help where I can.  

* I have other projects I want to work on in my free time that can use
the enhanced functionality and nice Pythonic API that lxml gives.  

* If at one point we can swap out ElementTree in yum and there is no
loss in performance we have the option to do so. 

Thanks for everyones input.

On Thu, 2005-05-12 at 12:34 -0400, John (J5) Palmieri wrote:
> This is just an exploratory e-mail as I don't know all the issues
> involved and don't want to get into a flamewar if someone has strong
> opinions on either side.  
> 
> I have been looking at what library to use for parsing the XML content
> in the dbus python bindings.  Suggestions were to use lxml
> (http://codespeak.net/lxml/) however we don't currently ship it.  Yum
> currently uses ElementTree for its parsing.  lxml aims to be compatible
> with the ElementTree API with a few exceptions.  On top of that it uses
> libxml2 as its base library and extends the ElementTree API with things
> like XPath, Relax NG, XSLT and c14n.  While the dbus bindings don't need
> these features some of the other stuff I want to work on may.  
> 
> Is it a possibility to port yum to lxml? Are we married to ElementTree?
> Would having both libraries in the distribution be objectionable? Does
> anyone else have a deeper knowledge of either or both libraries that can
> shed more light on the issue.
> 
> -- 
> John (J5) Palmieri
> Associate Software Engineer
> Desktop Group
> Red Hat, Inc.
> Blog: http://martianrock.com
> 
-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com




More information about the fedora-devel-list mailing list