XML Question

  • Thread starter Thread starter eric
  • Start date Start date
E

eric

Hi,

I have a container class that I want to serialize to a XML file. This file
will be opened by a legacy application (VB6 using MSXML 4.0). What is the
best way to accomplish this? Should I manually loop through each property
in the class? Should I serialize the class? Looking for a way that is the
easiest on the legacy app to open?

Thanks
 
Hi,

I have a container class that I want to serialize to a XML file. This file
will be opened by a legacy application (VB6 using MSXML 4.0). What is the
best way to accomplish this? Should I manually loop through each property
in the class? Should I serialize the class? Looking for a way that is the
easiest on the legacy app to open?

Since it's just XML, the legacy app won't have any problem reading it.
However, I would implement the ISerializable interface and control
serialization yourself. That will at least give you some level of
control over what goes out to the client. Could save you in the future
if something with the built-in serialization changes.
 
Patrick,

Thanks for the post. In my class I have properties set for each class
variable. These are the values I want to persist. I was thinking instead
of hard coding each property, I would use reflection and loop through each
property and save it. Wht do you think?

Thanks
 

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

Back
Top