Конвертировать Python ElementTree в строку
Всякий раз, когда я звонюElementTree.tostring(e)
Я получаю следующее сообщение об ошибке:
AttributeError: 'Element' object has no attribute 'getroot'
Есть ли другой способ преобразовать объект ElementTree в строку XML?
Проследить:
Traceback (most recent call last):
File "Development/Python/REObjectSort/REObjectResolver.py", line 145, in
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'