1

如何设置我的类以反序列化以下混合内容 xml?

<employee>
  <name>John Doe</name>
  <remark>He is a <match>tall</match> and handsome man</remark>
</employee>
4

1 回答 1

1

这应该这样做。

[System.Xml.Serialization.XmlElementAttribute("match")]
public match[] match {
  get {
    return this._match;
  }
  设置 {
    this._match = 值;
  }
}

///
[System.Xml.Serialization.XmlTextAttribute()]
public string[] Text {
  get {
    return this.textField;
  }
  设置 {
    this.textField = 值;
  }
}
于 2010-09-16T03:41:49.897 回答