I have inheritance between classes which are the result of xml
serialization.
My question is how can I insure in serializaion stage that the hierarchy
in xml is according to inheritance hierarchy in classes?
Thank you very much!
*** Sent via Developersdex http://www.developersdex.com ***
Hi,
Can you give more details? it;s not very clear where is your problem.
E.g. try to deserialize the class tree, then validate the result.
Regards, Alex
[TechBlog] http://devkids.blogspot.com
cc> Hello!
cc>
cc> I have inheritance between classes which are the result of xml
cc> serialization.
cc> My question is how can I insure in serializaion stage that the
cc> hierarchy
cc> in xml is according to inheritance hierarchy in classes?
cc> Thank you very much!
cc>
cc> *** Sent via Developersdex http://www.developersdex.com ***
cc>
See XmlAnyAttributeAttribute / XmlAnyElementAttribute:
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlanyattributeattribute.aspx
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlanyelementattribute.aspx
Marc
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.unknownnode.aspx
"By default, after calling the Deserialize method, the XmlSerializer
ignores XML nodes of unknown types. However, you can use this event to
handle such node types."
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.unknownattribute.aspx
"By default, after calling the Deserialize method, the XmlSerializer
ignores XML attributes of unknown types. However, you can use this event
to handle such node types."
Marc