Xml deserialization asymmetry issue

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I think I am running into an Xml asymmetric deserialization issue. Weve got Xml in the following custom format:
<pre class="prettyprint <parent>
<child text="text1" description="description content</child>
<child text="text2" description="description content</child>
<child text="text3" description="description content</child>
<child text="text4" description="description content</child>
</parent>[/code]
Its a little more complicated than that, in that the Child contents can be unicode, so were talking about a UTF-8 or possibly UTF-16 type encoding.
That aside, its a bit unusual since we have a custom format, we havent taken the time to use build in C# attributes to capture lists or arrays or the like. Weve just dumped it out in custom format. So were "stuck" with it for the time being unless we
want to revise production units, yada, yada, yada, cost Id like to avoid.
I am running into issues getting out of sync, but Im not sure its because I am creating a new XmlSerializer from the Parent ReadXml method. I should just pass in the reader to a new instance of the Child class and call it done, let the Childs ReadXml
handle its own through the Parents reader?
Regards,
Michael

View the full article
 
Back
Top