Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XmlDocument class is removing formatting, c#, .NET

i was wondering if anyone knows how to stop xmldocument.Save() from reformatting the document.

Its not that the document is not formatted correctly with respect to XML, the particular document i am working with has lots of white space and things like that which - upon save - is all being removed.

like image 808
Grant Avatar asked Nov 05 '09 22:11

Grant


1 Answers

Set the PreserveWhiteSpace property to true before you save the document.

like image 77
Mike Atlas Avatar answered Nov 14 '22 21:11

Mike Atlas