Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'missed': 0.09; 'python': 0.09; 'attribute.': 0.09; 'portions': 0.09; 'subject:howto': 0.09; 'url:github': 0.09; 'attribute,': 0.16; 'disk.': 0.16; 'examples:': 0.16; 'gained': 0.16; 'iteratively': 0.16; 'recently.': 0.16; 'subject:XML': 0.16; 'url:py': 0.16; 'wrote:': 0.17; 'documented': 0.17; 'stefan': 0.17; 'libraries': 0.22; 'external': 0.24; 'feature': 0.24; 'specifically': 0.24; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'andrew': 0.27; 'see,': 0.27; 'tree': 0.27; 'subject:/': 0.28; 'markup': 0.29; 'manual': 0.29; 'this.': 0.29; 'to:addr:python- list': 0.33; 'thanks': 0.34; 'there': 0.35; 'but': 0.36; "i'll": 0.36; 'should': 0.36; 'xml': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'several': 0.39; 'to:addr:python.org': 0.39; 'subject:, ': 0.61; 'received:phx3.secureserver.net': 0.62; 'received:prod.phx3.secureserver.net': 0.62; 'here': 0.65; 'header :Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'day': 0.73; 'subject:XHTML': 0.84; 'tree,': 0.84; 'url:master': 0.84; 'received:173.201': 0.91; 'url:tutorial': 0.93 Date: Wed, 23 Jan 2013 23:32:48 +0000 From: Andrew Robinson User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120909 Thunderbird/15.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: XML/XHTML/HTML differences, bugs... and howto References: <5100002F.7020809@r3dsolutions.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: andrew3@r3dsolutions.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359012888 news.xs4all.nl 6846 [2001:888:2000:d::a6]:36403 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37543 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. :)