我在一个 XML 文件中有以下数据,我正在使用下面提到的 python 代码读取这些数据,然后将其写入 Outlook,当它写入 Outlook 时,我看到所有数据都打印在一行中。我想在之后打印一行另外,我尝试在每行末尾的 xml 文件中使用“br”标签,将每一行包裹在“br”和“/br”周围,但似乎没有任何效果,有什么建议吗?XML
<rel_notes>
1.)Please move to this build for all further test and development
activities .
2.)Please use this as a basebuild to verify
compilation and sanity
3.)Any CL that nees to be integrated must
have a CL
</rel_notes>
Python代码
from xml.etree import cElementTree as etree
tree = etree.parse(file)
Releasenotes = ('\n'.join(elem.text for elem in tree.iter('rel_notes')))
输出
Release notes: 1.)Please move to this build for all further test and development activities 2.)Please use this as a basebuild to verify compilation and sanity 3.)Any CL that nees to be integrated must have a CL