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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:42:47+00:00 2026-06-15T10:42:47+00:00

I am pulling an xml file from third party app which looks like this

  • 0

I am pulling an xml file from third party app which looks like this

<round round_id="14208" name="5th Round" start_date="2013-09-06" end_date="2013-09-10" type="cup" groups="0" has_outgroup_matches="no" last_updated="2011-04-05 14:15:02">
    --Some Data with more elements
</round>

<round round_id="14208" name="5th Round" start_date="2013-09-06" end_date="2013-09-10" type="cup" groups="0" has_outgroup_matches="no" last_updated="2011-04-05 14:15:02">
    --Some Data with more elements
</round>

My problem is some time this tag comes with self closing tag like this

<round round_id="14208" name="5th Round" start_date="2013-09-06" end_date="2013-09-10" type="cup" groups="0" has_outgroup_matches="no" last_updated="2011-04-05 14:15:02"/>

I want to check for self closing tags and remove the element.

Please help me out.
Thanks

  • 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-15T10:42:48+00:00Added an answer on June 15, 2026 at 10:42 am
    var file = "C:\\YourPath\\data.xml";
    var doc = new XmlDocument();
    doc.Load(file);
    var nodes = doc.SelectNodes("/rounds/round");
    foreach (XmlNode item in nodes)
    {
        if (item.InnerXml == String.Empty)
        {
            item.ParentNode.RemoveChild(item);
        }
    }
    doc.Save(file);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pulling in a URL from an XML file which leads with the
I am pulling categories from an xml file. I only have 5 categories but
I am pulling info from an XML file and the div class=long works great
I have a helper class pulling a string from an XML file. That string
I am using SAX to parse an XML file I'm pulling from the web.
I'm pulling in an XML file from the internet and loading it on the
This is driving me a little crazy. I am pulling an XML string from
I am currently pulling start times from an XML file and using a date
I've got a VBS file that is pulling XML from our website. It going
I'm pulling results from an XML file and one of the values (an actual

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.