我需要新的命名空间添加到我的饲料的RSS(根)元素,除了A10:覆写根元素,添加命名空间根元素
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
<channel>
.
.
.
我使用SyndicationFeed类序列化到RSS 2.0和我使用的XmlWriter输出馈送,
var feed = new SyndicationFeed(
feedDefinition.Title,
feedDefinition.Description,
.
.
.
using (var writer = XmlWriter.Create(context.HttpContext.Response.Output, settings))
{
rssFormatter.WriteTo(writer);
}
我曾尝试添加上SyndicationFeed AttributeExtensions但它增加了新的命名空间 给信道元件代替根,
谢谢
也许你可以写一个临时的MemoryStream,以加载内容的XmlDocument的,你可以解决什么你想。只有这样,才能将xml内容写入输出 –