views:

62

answers:

1

How do I setup my class to deserialize the following mixed content xml?

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

This should do it.

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

///
[System.Xml.Serialization.XmlTextAttribute()]
public string[] Text {
  get {
    return this.textField;
  }
  set {
    this.textField = value;
  }
}
Sean