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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:53:21+00:00 2026-05-23T00:53:21+00:00

We have to send xml to a black box processor which does not handle

  • 0

We have to send xml to a black box processor which does not handle contracted empty elements properly, and of course, which we can’t change directly.

If we send:

<element />

We get back:

<element>\n</element>  

which renders as

    <element>
</element> 

which causes our customers processes to react badly

We should (need to) get back:

<element></element> 

When we send over:

<element></element>

the result is as desired, so we need to send

<element></element>

not

to the black box.

When examining the attributes of the empty elements we noted that

<element /> 

registered isEmpty == true while

<element></element> 

registered isEmpty as false, so as an attempted hack we ran this loop:

        foreach (XElement feature in _xDocument.Descendants("feature").Where(feature => feature.Element("expiry").IsEmpty))
        {
            feature.Element("expiry").Value = string.Empty;
        }

And in debugging we determined that isEmpty became false, and in debugging environment when sending this to the black box, all was well, but when we deploy to our dev server (and test and prod of course), we still end up seeing output from the black box as if the tags are going over as empty.

How can we force all empty elements in an XML document to always render as expanded tags?

This is a critical bug fix for us at this point – downstream customers are being negatively affected.

Thanks very much!

  • 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-23T00:53:22+00:00Added an answer on May 23, 2026 at 12:53 am

    Look here:

    Render Empty XML Elements as Parent Elements

    • 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 which I need to parse using PHP and send
HI I have an xml file with 500KB size which i need to send
I have a web service to which I send a xml request (application/x-www-form-urlencoded encoded)
In my project there are situations where we have to send xml messages (as
In my app i have to send a xml data as request, I am
I want to have a PHP script send a XML formatted string to another
i have a scenario where in i need to send an xml as a
I am trying to send raw xml to a service in Python. I have
I have an XML object that I want to send to my player via
I have to send an XML request to recover data from a remote server

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.