By John Schofield
I have developed a C# component that converts objects to an XML stream and vice versa. The main .NET focus is on System, System.Reflection and System.XML assemblies. The user has access to a default constructor and four public methods; two methods to create an XML stream or file from an object and two that creates an object from from an XML file or stream
In the creation of the stream, the component does a deep copy of any contained objects. One conversion limitation relates to collections. Currently only and ArrayList and Hashtable are supported. A future enhancement would be to add a schema.
The complete source code, include test code, is contained in XmlStream.zip.
The zip file contains three projects. XmlStreamLib is the conversion code.
TestXmlStreamLib contains code for the objects to be converted. Finally, TestXmlStreamProj holds the executable.
Download XmlStream.zip