Empty Element XML

Hi,

Why would XML display this:

<Code> </Code>

Instead of this

</Code>

For empty elements?
andyw27Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ivo StoykovCommented:
Hi

1st it depends which is the tool you're using to display it
2nd it seems to me there is a space as a contents of the node.
3rd if the node it empty it is the same whether it will be shown as <Code></Code> or <Code />

HTH

Ivo Stoykov
0
Pratima PharandeCommented:
stackoverflow.com/questions/7238254/xml-what-is-this-null-or-empty-element

this link will provide you some moew explanation
0
andyw27Author Commented:
Slightly strange, if I open my XML file I see this:

    <Code>
    </Code>

If I change to this:

<Code></Code>

When viewed in the browser I then get this:

</Code>
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Ivo StoykovCommented:
This is because it has been generated with new line as node contents. When you remove it there is no more contents and the node is shortened.

HTH

Ivo Stoykov
0
andyw27Author Commented:
How can I turn off that feature?
0
Ivo StoykovCommented:
This is not a feature - it is added by the XML generator - should trace why and when is added.
Generally you shouldn't bother about this...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.