Re: Xml serialization/deserializationThanks for your reply
I was also thinking about using SOAP, however I am not serializing/deserializing to/from file or to/from systems understanding SOAP, but to/from an application (out of my control) which only understands "simple XML" according to a defined schema (xsd).
It is only the deserialization (when receiving from the foreign application) which creates a problem.
Of course I can write a taylor made deserializer, but not if this can be solved with existing functionality.
"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in message news:Oy**************@TK2MSFTNGP15.phx.gbl...
You can get the XmlSerializer to produce an XML format that follows the serialization guidelines of the SOAP 1.0/1.1 Section 5 standard [0]. It's not a very readable format but it maintains object references during serialization.
See [1] or [2] for some examples.
HTH,
Christoph Schittko
MS MVP XML
http://weblogs.asp.net/cschittko
[0]
http://www.w3.org/TR/2000/NOTE-SOAP-...#_Toc478383512
[1]
http://www.dotnet247.com/247referenc...33/169909.aspx
[2]
http://msdn.microsoft.com/library/en...asp?frame=true -----Original Message-----
From: Snowman [mailto:ma**********@bluezone.no]
Posted At: Wednesday, September 22, 2004 8:09 AM
Posted To: microsoft.public.dotnet.xml
Conversation: Xml serialization/deserialization
Subject: Xml serialization/deserialization
Suppose I have a RootObject which holds a collection of other objects.
The other objects have a property (Parent) which refers back to the
"parent"
collection (b.t.w. my collection is based on CollectionBase), in similar
fashion as the object models of MS Office.
I want to serialize this object graph (with RootObject as the xml document
element) without Parent property serialized, this may be done by adding
XmlIgnoreAttribute on the Parent property (or if it should be a public
field).
Anyone knows a way to instruct the XmlSerializer to maintain the Parent
property during deserialization, or some other useful techniques ?