I have the following data in an XML file which i am reading using the below mentioned python code and then writing that to outlook,when its written to outlook I see all the data gets printed in one line..I want to print one line after the other,I tried to use “br” tag in the xml file at the end of everyline,wrap each line around “br”and “/br” but nothing seems to work,any suggestions?
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 code
from xml.etree import cElementTree as etree
tree = etree.parse(file)
Releasenotes = ('\n'.join(elem.text for elem in tree.iter('rel_notes')))
OUTPUT
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
I don’t use the standard XML Python lib, but
lxmlwhich is more powerful (support of XPath, etc). It looks like it works basically as you wish: