ElementTree vs. lxml (python XML libraries)

John (J5) Palmieri johnp at redhat.com
Thu May 12 19:11:09 UTC 2005


On Thu, 2005-05-12 at 14:30 -0400, seth vidal wrote:
> > 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.  
> 
> Oh - one thing tangentially related - you've seen the simple dbus event
> notifier that nasrat wrote for doing this, right?
> 
> https://www.redhat.com/archives/fedora-config-list/2005-March/msg00008.html
> 
> instead of parsing it on its own it lets yum do the work for it and send
> the events that way.
> 

Looks cool.  I'm actually trying to parse introspect data not yum data
it is just yum uses an xml library and it would be nice if both dbus and
yum used the same one.  Hmm, I should send a patch to that to Paul to
keep up to date with the new bindings.

Looking further into it it seems that yum uses some lowlevel stuff
(iterparse) that is not emulated by lxml.

-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com




More information about the fedora-devel-list mailing list