[quoted text, click to view] Dave Sexton wrote:
> Hi Sam,
>
> That depends on the reason why you are serializing the TextDocument and its
> containing object in the first place. Your could save the TextDocument to a file,
> possibly on a web server, and serialize a path string. During deserialization
> locate the file (and download it if necessary), then reload it into a TextDocument.
> You might have to download the document asynchronously, so the client should
> be aware of any possible caveats.
Dave,
Thank you for your reply!
I have two types of serialization going on. One is to a file and the
other is across the wire. The application I am working on is a
client/server app where currently both are on the same physical
machine, in version 2, they can be on separate machines, but all in the
same local area network. There is no plain to ever make this system
work over the Internet or use any web server type of things.
The XML is created in an XmlDocument object that is the raw data for a
report. The XmlDocument object is being added to a C# business class
call "ReportDocument" which contains additional information. It is
within this Report class that I need to figure out how to serialize the
XmlDocument.
The code that writes a ReportDocument to file is generic, right now at
least, to how all documents within the system are written to file and
they all depend on the object implementing the ISerializable interface.
I am using standard remoting to send objects across the wire, right
now, too. So both remoting and writing to file is using ISerializable.
After some testing, it looks like if the text within the XML is
compressed, I can get the size down to under half a meg of data, so I
would be comfortable with serializing that size of binary blob. In the
short term, I think this is the best approach. Is there a better one?
Assuming my approach, I figure I can stream the XmlDocument to a memory
stream and then compress the memory stream, but I am back at how best
to stream this compresed blob into the SerializationInfo. Any
thoughts?
Sam