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
 
Back
Top