Raymond Hettinger added the comment: What would you have it do in the general case, should it concatenate all the text in:
>>> root4 = ET.fromstring('<a>abc<b>def</b>ghi</a>') >>> root4.text 'abc' If I'm interpreting the XML spec correctly ( http://www.w3.org/TR/2006/REC-xml-20060816/#sec-starttags section [43]), the optional character data must be a the beginning of the element before any other elements, comments, or processing instructions: content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)* In other words, I'm not sure your XML is considered well-formed. ---------- nosy: +rhettinger _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24072> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com