"Deep" XML Serialization of objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jesper Denmark

    #1

    "Deep" XML Serialization of objects

    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>








  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: &quot;Deep&quot ; XML Serialization of objects

    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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Jesper Denmark" <jeodni@hotmail .com> wrote in message
    news:1d8c01c373 a7$cb3ad8f0$a30 1280a@phx.gbl.. .[color=blue]
    > 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>
    >
    >
    >
    >
    >
    >
    >
    >[/color]


    Comment

    Working...