[issue38011] xml.dom.pulldom splits text data at buffer size when parsing from file

Noam Sturmwind report at bugs.python.org
Mon Sep 2 12:35:31 EDT 2019


Noam Sturmwind <noam at sturmwind.ca> added the comment:

I believe this is working as intended, but is potentially surprising behavior. If so, perhaps a note could be added to the xml.dom documentation mentioning that this needs to be accounted for.

Per https://stackoverflow.com/a/317494 a correct way to read the text is

''.join(t.nodeValue for t in node.childNodes if t.nodeType == t.TEXT_NODE)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38011>
_______________________________________


More information about the Python-bugs-list mailing list