classification
Title: Suggest a textlist() method for ElementTree
Type: enhancement Stage:
Components: XML Versions: Python 2.6
process
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 2007-09-11 06:15 by effbot. This issue is now closed.

Files
File name Uploaded Description Edit
xmldemo2.py 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 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498286

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 effbot.org 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").
History
Date User Action Args
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