我想使用 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" />
那么生成前缀标签的正确方法是什么?