Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8791519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:51:14+00:00 2026-06-13T22:51:14+00:00

I have the following data in an XML file which i am reading using

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:51:15+00:00Added an answer on June 13, 2026 at 10:51 pm

    I don’t use the standard XML Python lib, but lxml which is more powerful (support of XPath, etc). It looks like it works basically as you wish:

    >>> s = """<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>"""
    >>> from lxml import etree
    >>> root = etree.fromstring(s)
    >>> root.text
    '\n    1.)Please move to this build for all further test and development \n    activities .\n    2.)Please use this as a basebuild to verify \n    compilation and sanity\n    3.)Any CL that nees to be integrated must \n    have a CL\n'
    >>> print root.text
    
        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
    
    >>> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following piece of code which tries to load an XML file from
Hi I have following which is not generating class file for complextypes using bindigs.xml
I have an XML file which describes the data-structure that I can exchange on
I have the following code which is trying to post xml constructed data to
I have a XML file with the following data format: <net NetName=abc attr1=123 attr2=234
I have the following xml file: <xfa:data> <form1> <Page1> <Page2> <contractInfo> ... </contractInfo> <paymentInfo>
I have a xml file main.xml with following markup and data. main.xml <xml> <content>
I have a big (1.9 GB) XML file which has data I want to
I have a PHP file which produces an Xml sitemap based on data which
I'm writing an iPhone app which fetches an XML file, parses it and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.