Serialization of multiple objects in same xml file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
is there a way we can serialize an object of add to an existing xml class ?
so for example we serialize an objectA of classA and create a xml file xmlA .
now we want to serialize objectB of classA and add to xmlA.

is it possible n how can we go abt it??

thnx
Amrita
 
Hi Annie,

You can create a collection of object (classA) and then serialize the
complete collection. (example:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=236)

You can also do it like this (although I would prefer the other method
(collection)). When specifying the filename for serialization (e.g. new
StreamWriter ("c:\\smtg.xml", TRUE)) - set the second parameter to true for
appending - so the whole XML data is appended to already existing data.

Regards,
Peter Jausovec
(http://blog.jausovec.net)
 

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