XmlDocument save and end tag formatting

  • Thread starter Thread starter Donal McWeeney
  • Start date Start date
D

Donal McWeeney

Hi,

I am doing some work with the XmlDocument class for loading and saving files
and I notice that the save call is writing out the empty element in the
following format <element /> - is this formatting possible to control? ie.
get it to write out <element></element>.

Thanks

Donal
 
Donal said:
I am doing some work with the XmlDocument class for loading and saving files
and I notice that the save call is writing out the empty element in the
following format <element /> - is this formatting possible to control? ie.
get it to write out <element></element>.

That's usually bad idea to rely on difference between these two forms,
because they are truly equivalent ones. Do you have some specific needs
or why do want to control such low level syntax sugar?

PS. You can try writing XML via XmlTextWriter with Formatting property
set to Formatting.Indented.
 
That's usually bad idea to rely on difference between these two forms,
because they are truly equivalent ones. Do you have some specific needs
or why do want to control such low level syntax sugar?

Agreed - next post on xml comparison tools would get around this - text file
comparison breaks this scenario.

Thanks

Donal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top