Does someone know if there is possibility to map elements attributes to parent class/struct members?
Example:
<parent>
<child id="1">
</parent>
I would like to have it mapped directly like this:
public class parent
{
public int id;
}
Thanks in advance
Update:
I haven’t specified it clearly, I’m looking for a solution attributes based solution that I can use XmlSerializer.
You’re going to have to implement your own
IXmlSeriazliableinterface.http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.aspx
Here’s a crude example:
This should work with the XmlSerializer.