Have you tried implemententing System.Xml.Serialization.IXmlSerializable

You can then serialise and deserialise in whatever way you want.
Return null or nothing from GetSchema(), and you're away.

You now have the two functions ReadXml and WriteXml to play with
which recieve System.Xml.XmlReader and System.Xml.XmlWriter
respectively.

The you can read and write in pretty much anyway you want,
is that the kind of thing you are after?


Jeremy

>>I understand fairly well the use of the [Serializable] attribute
>>and the native Binary
>>IFormatter interface. I understand also that there is XML and SOAP
>>serialization. But all of these seem to serialize to the CLR's view of
>>an object or something with XML Schema types. What I actually have to do
>>is: we have some XML files that we create in our application. They were
>>defined before XML schema and they are not Schema compliant. I have some
>>.NET classes I am defining and I need to put the data/state in them
>>written out to these XML files in a certain format. The trick is I can't
>>just dump .NET's "view" of the objects. The XML files have a certain
>>format. Can I make use of any of XML Serialization or do I just have
>>"pound" XML into the files using classes in System.Xml? In other words,
>>how customizable is the XML serialization? Any ideas would be greatly
>>appreciated.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to