XmlSerialize to XmlDocument

G

Guest

Hi,
I have noticed that the XmlSerializer seems only to serialize to a file of sorts. What I would like to do is take an object, serialize it to an XmlDocument in memory (or some other way to hold the Xml data in memory), and then pass it to another function. Is there anyway to do this without writing to the disk in the middle?

Thank you,
Tim
 
A

Adam Clauss

Well, not 100% sure if this will work :)
The Serialize/Deserialize methods take a Stream object, correct?

What about creating a MemoryStream object (System.IO.MemoryStream) and
passing that?

--
Adam Clauss
(e-mail address removed)
Tim said:
Hi,
I have noticed that the XmlSerializer seems only to serialize to a
file of sorts. What I would like to do is take an object, serialize it to
an XmlDocument in memory (or some other way to hold the Xml data in memory),
and then pass it to another function. Is there anyway to do this without
writing to the disk in the middle?
 

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

Top