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

  • Home
  • SEARCH
  • 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 6123767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:03:18+00:00 2026-05-23T16:03:18+00:00

I have an xml file where I need to strip out xml tags where

  • 0

I have an xml file where I need to strip out xml tags where if possible I can use a wild card because the data within the tags will be different information. See xml below:

 <relationship relation="1">
        <sourcedid>
            <source>xxxxx</source>
            <id>AbDT-1398</id>  ***this data will be different for each grouping****
        </sourcedid>
        <label/>
    </relationship>

Basically I need to search the xml file for the grouping and have a wild card character within the tags and remove the entire grouping. Throughout my xml the tag is listed but the data is what changes.

  • 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-05-23T16:03:19+00:00Added an answer on May 23, 2026 at 4:03 pm

    If I got you right, you want to remove certain tags (and eventually their contents) from your xml file. Try using lxml for processing the lxml file. Have a look at these functions from lxml.etree.

    • strip_elements():

    Delete all elements with the provided
    tag names from a tree or subtree. This
    will remove the elements and their
    entire subtree, including all their
    attributes, text content and
    descendants.

    • strip_tags():

    This will remove the elements and
    their attributes, but not their
    text/tail content or descendants.
    Instead, it will merge the text
    content and children of the element
    into its parent.

    Is this what you are looking for? If yes, there is nice answer on SO you should have a look at.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xml file where I need to comment out a whole piece
I have the below xml file and I need to use an xpath to
I need to insert, delete and update data using a xml file. I have
I have an XML file which I need to read and load the data
I have a fixed-length data file need to persistence into database. I use a
Possible Duplicate: How can I produce a PDF file using data in an XML
I have a XML file that I need to parse in the Android SDK.
I have an XML file which I need to parse using PHP and send
i have an xml file sitemap.xml as shown below ..i need to add one
I have an XML file consisting of Name/Value pairs that I need in a

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.