On 01/24/2013 06:42 AM, Stefan Behnel wrote:
Andrew Robinson, 23.01.2013 16:22:
Good day :),
Nope, you should read the manual on this. Here's a tutorial:
http://lxml.de/tutorial.html#elements-contain-text
I see, so it should be under the "tail" attribute, not the "text"
attribute. That's why I missed it.
But, I don't see a way to write portions of an XML tree, or iteratively
write a tree to disk.
How can this be done?
There are several ways to do it. Python has a couple of external libraries
available that are made specifically for generating markup incrementally.
lxml also gained that feature recently. It's not documented yet, but here
are usage examples:
https://github.com/lxml/lxml/blob/master/src/lxml/tests/test_incremental_xmlfile.py
Stefan
Thanks Stefan ! I'll look that over. :)
--
http://mail.python.org/mailman/listinfo/python-list