XmlDocument class removes formatting, C # ,. NET

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

It’s not that the document has not been formatted correctly with respect to XML, there is a lot of free space in the specific document I am working with and things like saving are all deleted.

+5
source share
2 answers

Before saving a document, set PreserveWhiteSpace to true.

+13
source

set PreserveWhiteSpace to true

0
source

All Articles