XML: Deserializing Objects

  • Thread starter Justin Armstrong
  • Start date
J

Justin Armstrong

I'm having difficulties deserializing some objects.
Consider the following example of what I'm trying to do:
----------------------------------------------------------
class Person
{
string name;
}

class Info
{
string A;
string B;
}
----------------------------------------------------------
Don't mind the ommitted XML tags or serialize functions.
The resultant XML file is a combination of a serialized
Info object and a serialized array of Person objects,
like so:
----------------------------------------------------------
<xml ...?>
<global>
<Info ...>
<stringA>blah</stringA>
<stringB>blah</stringB>
</info>
<ArrayOfPerson ...>
<Person>
<name>bob</name>
</Person>
 
J

Justin Armstrong

The solution is to use a new XMLSerializer. Apparently
you can't use the same serializer object for two
different object types.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top