每当我打电话时ElementTree.tostring(e),都会收到以下错误消息:
AttributeError: 'Element' object has no attribute 'getroot'
Run Code Online (Sandbox Code Playgroud)
有没有其他方法将ElementTree对象转换为XML字符串?
追溯:
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'
Run Code Online (Sandbox Code Playgroud)