【发布时间】:2010-04-15 19:06:59
【问题描述】:
如何设置我的类以反序列化以下混合内容 xml?
<employee>
<name>John Doe</name>
<remark>He is a <match>tall</match> and handsome man</remark>
</employee>
【问题讨论】:
标签: c# .net xmlserializer mixed
如何设置我的类以反序列化以下混合内容 xml?
<employee>
<name>John Doe</name>
<remark>He is a <match>tall</match> and handsome man</remark>
</employee>
【问题讨论】:
标签: c# .net xmlserializer mixed
应该这样做。
[System.Xml.Serialization.XmlElementAttribute("match")]
公共匹配[]匹配{
得到 {
返回 this._match;
}
设置 {
this._match = value;
}
}
///
[System.Xml.Serialization.XmlTextAttribute()]
公共字符串[] 文本 {
得到 {
返回 this.textField;
}
设置 {
this.textField = 值;
}
}
【讨论】: