XmlDocument class is removing formatting, c#, .NET

泄露秘密 提交于 2020-01-03 13:01:30

问题


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.


回答1:


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




回答2:


set PreserveWhiteSpace to true



来源:https://stackoverflow.com/questions/1684253/xmldocument-class-is-removing-formatting-c-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!