【发布时间】:2019-06-26 09:55:39
【问题描述】:
使用以下方法将 JSON 转换为 XML 后:
var xml = XDocument.Load(JsonReaderWriterFactory.CreateJsonReader(Encoding.ASCII.GetBytes(json), new XmlDictionaryReaderQuotas()));
我得到类似的输出:
<a type="object">
<b type="array">
<item type="object">
...
</item>
<item type="object">
...
</item>
</b>
</a>
有没有人知道一种让 XML 看起来像这样的简单方法:
<a type="object">
<b type="object">
...
</b>
<b type="object">
...
</b>
</a>
我需要这种格式的它来匹配我的 XSLT 转换模板。
非常感谢, 启
【问题讨论】:
-
@Sinatr 太好了,谢谢!
-
答案可以在 - stackoverflow.com/questions/40213787/… 根据 Sinatr 的评论找到