I’m using the .NET XmlSerializer class to deserialize some XML document. In that document, I have an element that looks like that:
<MyElement attr1="xxx" attr2="yyy">VALUE</MyElement>
This is a part of a bigger XML. I need to deserialize this string into an object, so I wrote:
public class MyElement
{
[XmlAttribute(AttributeName = "attr1")]
public string attr1 { get; set; }
[XmlAttribute(AttributeName = "attr2")]
public string attr2 { get; set; }
[??????????????]
public string value { get; set; }
}
And I can’t figure out what to put instead of the question marks in order to get the value of the element into the value.
XmlTextAttribute: