py.user added the comment:

Serhiy Storchaka wrote:
> I believe that in particular you can mix Python and
> C implementations of Element and lxml.etree elements in one tree.

The xml.etree.ElementTree.ElementTree() can accept lxml.etree.Element() as a 
node, but node in node is impossible.

>>> import xml.etree.ElementTree as etree_xml
>>> import lxml.etree as etree_lxml
>>> elem1 = etree_xml.Element('a')
>>> elem2 = etree_lxml.Element('b')
>>> elem1.append(elem2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: must be xml.etree.ElementTree.Element, not lxml.etree._Element


Python tracker <>
Python-bugs-list mailing list

Reply via email to