[lxml-dev] etree not printing pretty :(

Hi all, I am rather new to python and lxml and I wonder about the output of my tree. I add an Element, which contains some childs to a tree. When I write the output everything is in pretty print, but the elements I appended. They show up in one line. Here is a snippet of my code:
eggs = et.fromstring(xmltransformed) for each in eggs: if each.tag == "someElement":
each.append(anotherElement)
else: pass
et.ElementTree(element=eggs).write(xmlout, pretty_print=True)
When I open the file in firefox its formated all right, but when I view the code 'anotherElement' with all its childs is just one line... what am I doing wrong here? python: 2.6 python-lxml: 2.1.5-1ubuntu2 OS: Ubuntu 9.04 Thanks for you help! Cheers, martin

Hi, Martin Seiler, 19.11.2009 11:30:
I am rather new to python and lxml and I wonder about the output of my tree. I add an Element, which contains some childs to a tree. When I write the output everything is in pretty print, but the elements I appended. They show up in one line.
did you read this? http://codespeak.net/lxml/FAQ.html#why-doesn-t-the-pretty-print-option-refor... Stefan
participants (2)
-
Martin Seiler
-
Stefan Behnel