XML/XHTML/HTML differences, bugs... and howto

Andrew Robinson andrew3 at r3dsolutions.com
Thu Jan 24 00:32:48 CET 2013

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. :)

More information about the Python-list mailing list