[lxml-dev] An lxml tree inside a lxml tree.

Albert Brandl albert.brandl at tttech.com
Wed Mar 26 11:15:55 CET 2008


With lxml 1.3.6, pretty-printing still is broken. If I append a subtree to an 
element,

>>> elem1 = fromstring("""
... <a>
...   <b/>
...   <c/>
... </a>""")
>>> elem2 = Element("e")
>>> elem2.append(elem1)

pretty-printing does not what I'd expect:

>>> print tostring(elem2, pretty_print = True)
<e>
  <a>
  <b/>
  <c/>
</a>
</e>

The indentation of the element "a" is correct, but it looks like pretty- 
printing is not applied to anything below (including the closing tag </a>).

I don't know if this problem also exists with lxml 2.x - we still use the
1.3 branch.

Best regards,

Albert


More information about the lxml-dev mailing list