【发布时间】:2010-05-11 12:16:30
【问题描述】:
我想使用 XmlSerializer 生成以下内容:
<atom:link href="http://dallas.example.com/rss.xml" rel="self" type="application/rss+xml" />
所以我尝试将命名空间添加到我的元素:
[...]
[XmlElement("link", Namespace="atom")]
public AtomLink AtomLink { get; set; }
[...]
但输出是:
<link xmlns="atom" href="http://dallas.example.com/rss.xml" rel="self" type="application/rss+xml" />
那么生成前缀标签的正确方法是什么?
【问题讨论】:
标签: c# xmlserializer