I need help, I have data coming in xml, I want to make an object from it, do something with it, serialize it and send it ... but it should be some kind of ordinary serialization.
xml like:
<Animals Ver="12" class="1" something="2"> <Dog Ver="12" class="2" something="17"> <Name> a </Name> <Sound> oof </Sound> <SomeOtherProp>12</SomeOtherProp> </Dog> <Cat Ver="12" class="3" something="4"> <Name> b </Name> <Sound> meow </Sound> </Cat> </Animals>
should be presented as:
abstract class Animal :XmlMagic { public string Name{get;set;} public string Sound{get;set;} public void SomeMagicalXMLSerializationMethod() {} public void SomeMagicalXMLDeSerializationMethod() {} } class Dog: Animal, XmlMagic { public int SomeOtherProp{get;set;} public void SomeMagicalXMLSerializationMethod() {} public void SomeMagicalXMLDeSerializationMethod() {} }
AK_
source share