remove element with ElementTree

Stefan Behnel stefan_ml at
Tue Mar 9 16:07:54 CET 2010

Justin Ezequiel, 09.03.2010 10:34:
> On Mar 9, 11:35 am, tdan< at>  wrote:
>> I have been using ElementTree to write an app, and would like to
>> simply remove an element.
>> But in ElementTree, you must know both the parent and the child
>> element to do this.
>> There is no getparent() function, so I am stuck if I only have an
>> element.
> see

Also note that there is an independent ElementTree implementation called 
lxml.etree, which has parent pointers.


More information about the Python-list mailing list