【发布时间】:2014-11-20 05:28:11
【问题描述】:
我的 XML 是一个字符串,需要在 div 中显示 我已经搜索了格式化 XML 的所有方法,但它不起作用,因为我最终将我的内容绑定到了一个 div。
以下是我在我的 asp.net 应用程序 c# 代码中使用的内容。
request = //my xml string
XDocument doc = XDocument.Parse(request);
divLogResults.InnerText = doc.ToString()
这里列出的所有方法我都试过了
What is the simplest way to get indented XML with line breaks from XmlDocument?
所以这不是重复的。我怎样才能以简单的方式做到这一点?
【问题讨论】: