Grant
Grant

Reputation: 11356

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.

Upvotes: 5

Views: 2915

Answers (2)

Mike Atlas
Mike Atlas

Reputation: 8231

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

Upvotes: 13

mfeingold
mfeingold

Reputation: 7154

set PreserveWhiteSpace to true

Upvotes: 0

Related Questions