all groups > dotnet xml > january 2007 >
You're in the

dotnet xml

group:

C# Serializing to XML Example


C# Serializing to XML Example Kurious Oranj
1/25/2007 7:42:32 PM
dotnet xml:
I wonder if someone could help here.

I'm trying to serialize a class with a parent/multiple child relationship.

In other words, there are 3 classes: parent, children, child. The parent
has a single children class. The single children class (which is
currently using iEnumerable and iEnumerator, but I'll change it if needs
be) has a number of child classes.

I keep doing things to try and get it to serialize, and all that happens
is the parent class comes out.

Does anyone please have a sample of how I need to set up the 3 classes
in order that this will serialize as I'm tearing my hair out here!
Nothing fancy, simpler the better.

Thanks in advance,
Re: C# Serializing to XML Example Kurious Oranj
1/25/2007 8:51:34 PM
[quoted text, click to view]
Tim,

I think I tried it, and it still didn't work. I'm just looking for a
working sample if possible. Something that shows me where everything
like that goes.

I posted my existing code in a later post.

Thanks,
Re: C# Serializing to XML Example Tim Van Wassenhove
1/25/2007 9:33:28 PM
Kurious Oranj schreef:
[quoted text, click to view]

Have you had a look at the XmlArrayItem attribute already?


--
Re: C# Serializing to XML Example Keith Patrick
1/26/2007 6:06:57 AM
You need to implement ICollection instead of IEnumerator, since the
deserializer needs access to an Add method


AddThis Social Bookmark Button