This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Suggest a textlist() method for ElementTree
Type: enhancement Stage:
Components: XML Versions: Python 2.6
Status: closed Resolution: accepted
Dependencies: Superseder: Update to latest ElementTree in Python 2.7
View: 1143
Assigned To: effbot Nosy List: effbot, loewis, rhettinger
Priority: normal Keywords:

Created on 2006-11-24 10:00 by rhettinger, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit rhettinger, 2006-11-24 10:00 Implementation and examples
Messages (4)
msg54942 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2006-11-24 10:00
This patch has a implementation and example for a method to recursively extract prose from nested XML markup.  This improves the utility of ElementTree for documents where otherwise contiguous PCDATA are broken-up by inspersed tags (e.g. xhtml or docbook fragments).

See attached file or the ASPN recipe at

msg54943 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-11-29 08:20
Why was this assigned to fdrake? Fredrik, can you please take a look? If not, please unassign.
msg54944 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2006-11-29 10:02
This is pretty much identical to the gettext and flatten helpers in the ElementLib utility library (see for links and code).  The current plan is to make some of these available as helper functions in ElementTree 1.3 (=Python 2.6), rather than methods.

I'm leaving this open as a reminder to self.
msg55812 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2007-09-11 06:13
ElementTree 1.3 provides a variant of this (tentatively called "itertext").
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44272
2007-09-11 06:15:21effbotsetstatus: open -> closed
2007-09-11 06:13:45effbotsetresolution: accepted
superseder: Update to latest ElementTree in Python 2.7
messages: + msg55812
2006-11-24 10:00:41rhettingercreate