Whenever I call ElementTree.tostring(e)
, I get the following error message:
AttributeError: 'Element' object has no attribute 'getroot'
Is there any other way to convert an ElementTree object into an XML string?
TraceBack:
Traceback (most recent call last):
File "Development/Python/REObjectSort/REObjectResolver.py", line 145, in <module>
cm = integrateDataWithCsv(cm, csvm)
File "Development/Python/REObjectSort/REObjectResolver.py", line 137, in integrateDataWithCsv
xmlstr = ElementTree.tostring(et.getroot(),encoding='utf8',method='xml')
AttributeError: 'Element' object has no attribute 'getroot'
See Question&Answers more detail:os