XML deserialization with an optional list

konoodd

New Member
I am trying to find out how to handle the de-serialization of XML. I do understand how to use the built in serialization and have done so before. My issue this time is that one section on the XML may be a list of messages or a single message.EDIT: The XML fragments below are snippets from a well formed XML document. When received, the XML will contain either the message list or a single message. The containing XML was left out for clarity and brevity.The XML fragment will look either like this...\[code\]<messageList> <message>message1</message> <message>message2</message></messageList>\[/code\]or like this...\[code\]<message>singleMessage</message>\[/code\]Is it possible to handle this using the built in .Net de-serialization or will I need to hand code this?
 
Back
Top