将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 <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'