开发者

XmlDocument OuterXml pretty printed

开发者 https://www.devze.com 2022-12-23 03:09 出处:网络
I\'ve got a XmlDocument and I want to get the Content (OuterXml) as a pretty printed string. How can I do this?

I've got a XmlDocument and I want to get the Content (OuterXml) as a pretty printed string. How can I do this?

Reg开发者_开发技巧ards


Assuming I understand this correctly

using System.Xml.Linq;
XDocument xDoc = XDocument.Load(@".....\test.xml");
string xDocString = xDoc.ToString(SaveOptions.None);
0

精彩评论

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