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 9297065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:58:37+00:00 2026-06-18T21:58:37+00:00

I am working with the xml labels from dailymed.nlm.nih.gov. I am having a problem

  • 0

I am working with the xml labels from dailymed.nlm.nih.gov. I am having a problem when reading the Contraindications associated with a drug. I want all of the content inside of the tag, but it cuts off once I hit the inner tag. I have tried iterating over all the subelements but the best I could do was get the “Warning” to display. “; anuria; hypersensitivity to …” was lost. If anyone know of a way to get this data using the parser it would help a lot.
Thank you!

 <component>
        <section ID="LINK_8e9e0719-efa5-451c-bea3-d547298ad0a1">
           <id root="8e9e0719-efa5-451c-bea3-d547298ad0a1"/>
           <code code="34070-3" codeSystem="2.16.840.1.113883.6.1" displayName="CONTRAINDICATIONS SECTION"/>
           <title>CONTRAINDICATIONS</title>
           <text>
              <paragraph>Atenolol and chlorthalidone tablets are contraindicated in patients with: sinus bradycardia; heart block greater than first degree; cardiogenic shock; overt cardiac failure (see<content styleCode="bold">
                    <linkHtml href="#LINK_0df2629f-13c7-4b14-8664-475c32377c68">WARNINGS</linkHtml>
                 </content>); anuria; hypersensitivity to this product or to sulfonamide-derived drugs.</paragraph>
           </text>
           <effectiveTime value="20101001"/>
        </section>
     </component>
  • 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-18T21:58:38+00:00Added an answer on June 18, 2026 at 9:58 pm

    Presuming you’re using something like the following you need to use ET.tostring which will get all the text of child elements.

    import xml.etree.ElementTree as ET
    txt = """
    <component>
    <section ID="LINK_8e9e0719-efa5-451c-bea3-d547298ad0a1">
        <id root="8e9e0719-efa5-451c-bea3-d547298ad0a1"/>
        <code code="34070-3" codeSystem="2.16.840.1.113883.6.1" displayName="CONTRAINDICATIONS SECTION"/
        <title>CONTRAINDICATIONS</title>
        <text>
        <paragraph>Atenolol and chlorthalidone tablets are contraindicated in patients with: sinus brady
            <linkHtml href="#LINK_0df2629f-13c7-4b14-8664-475c32377c68">WARNINGS</linkHtml>
                </content>); anuria; hypersensitivity to this product or to sulfonamide-derived drugs.</
        </text>
        <effectiveTime value="20101001"/>
    </section>
    </component>"""
    
    root = ET.fromstring(txt)
    
    for e in root.iter('text'):
        print ">>"
        print ET.tostring(e, method="text")
        print "<<"
    

    Gives

    >>
    
        Atenolol and chlorthalidone tablets are contraindicated in patients with: sinus bradycardia; heart block greater than first degree; cardiogenic shock; overt cardiac failure (see
            WARNINGS
                ); anuria; hypersensitivity to this product or to sulfonamide-derived drugs.
    
    
    <<
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with XML data from an application where we get XML like this:
I want to create a ASP.NET user control from an XML using XSLT. Currently
I was trying out a ListActivity example from the net. I am having problem
my question is the following, which is the best way of working XML (kml)
I am working with XML files that are generated by a digital video camera.
I'm working with XML and Flash. I tried to pass XML values to my
I have been working with XML for a while now, but some things I
I'm way new to working with XML but just had a need dropped in
I'm relatively new to working with XML and am working with some rather large
I'm working with a xml file that is generated and used in a .NET

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.