开发者

.net xml serialization, possible to apply some formatting?

I use a lot of XML seriali开发者_高级运维zation in one app I am busy with. .Net by default just shoves everything on 1 line.

Is it not possible to get some formatting order during the serialization. Would like to have it neater, because at times people have to open these xml files up and read them.

I guess what would be awesome is to have correct indentation and line breaks.

Thanks in advance


On your XmlTextWriter object, set the Formatting to Formatting.Indented, and set the Indentation property to the number of spaces to indent each level.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜