gpt4 book ai didi

c# - XmlDocument OuterXml 打印漂亮

转载 作者:行者123 更新时间:2023-11-30 12:36:51 30 4
gpt4 key购买 nike

我有一个 XmlDocument,我想将内容 (OuterXml) 作为 pretty-print 字符串获取。我该怎么做?

问候

最佳答案

假设我理解正确

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

关于c# - XmlDocument OuterXml 打印漂亮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2447176/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com