"Deep" XML Serialization of objects

J

Jesper Denmark

Hi,

Is deep serialization possible using XML. Know any good
tutorials?.

By deep serialization I mean the ability that an object
being serialized automatically serialize its members. E.g

Class A
{
public string x;
}

Class B
{
public string y;
public A a;
}

When serializing B an xml output like:

<classBroot>
<y>y-string</y>
<classAroot>
<x>x-string</x>
</classAroot>
<classBroot>
 
N

Nicholas Paldino [.NET/C# MVP]

Jesper,

Serialization automatically implies "deep" behavior. If an object is
serialized, then all of the information that the object references will be
serialized as well. Only members that are marked as non serializable will
not be serialized.

Hope this helps.
 

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