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>
user317871
  • 11
  • 2

1 Answers1

1

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
  • 11
  • 1
  • 1
    But here you are missing the order of content, You are splitting text and match to different arrays. – Kartheek Sep 01 '16 at 20:52