all groups > dotnet xml > november 2003 >
You're in the

dotnet xml

group:

XmlDocument save and end tag formatting



XmlDocument save and end tag formatting Donal McWeeney
11/28/2003 4:50:02 PM
dotnet xml: 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

Re: XmlDocument save and end tag formatting Dave Marteinson
11/28/2003 6:58:37 PM

[quoted text, click to view]

Why do you want to do that?

-djm

Re: XmlDocument save and end tag formatting Oleg Tkachenko
11/28/2003 9:02:08 PM
[quoted text, click to view]

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.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel
Re: XmlDocument save and end tag formatting Donal McWeeney
12/1/2003 10:40:13 AM
[quoted text, click to view]

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

Thanks

Donal

AddThis Social Bookmark Button