Delphi Serialize Object To Xml

So, I'd like to find an XML serializer for generic Delphi components, similar to the XmlSerializer used in the .NET FW.
The real problem with using binary streaming methods such as Stream's WriteComponent and ReadComponent nominally support similar functionality, it isn't:

  1. C# Serialize Object To File
  2. Delphi Serialize Object To Xml File
  3. Xml Serialize C# Class
  4. C# Serialize To Xml

  • User editable
  • Terribly safe when dealing with multiple versions of components
  • Very effective at saving the state of nested components (Comp1.Comp2, etc.)

The NativeXml and OmniXML open source libraries can convert Delphi objects to XML (not XSD). They support object serialization and deserialization even with Delphi versions before 2010. So it would be possible to use them in a first step to create a XML file, which then can be passed to the Data Binding Wizard for Delphi class code generation. Delphi Serialize Class To Xml. In computer science, in the context of data storage, serialization (or serialisation) is the process. JSON is a lighter plain-text alternative to XML which is also commonly used for client-server communication in. Implementing the interface marks the class as 'okay to serialize', and Java then handles.


  1. Does anyone have a 'SIMPLE' example of using XML Serialization in Delhi.Net for saving and loading an object. I am having problems trying replicate the ms examples. Specifically, the XmlSerializer.Create where the third of the parameters it an array of Type. Unfortunately, 'Type' is a Delphi keyword used to define a class among other things.
  2. OXml is the ultimate XML&JSON library for Delphi and FPC/Lazarus. It was written in both performance and versatility in mind. OXml is completely written in Object Pascal and supports all platforms and compilers of Delphi and C Builder. OXml features: XML DOM with XPath and namespace support. Sequential XML DOM parser – in order to parse.
While the XML data binding wizard provides similar functionality it has other drawbacks such as:

  • Forces you to keep an external XML/XSD/etc. file in synch with the code
  • Tool-generated, so you can't just edit the code, and have to rely on Adapter classes, or a lot of manual editing
  • Also not great for versioning

C# Serialize Object To File


Delphi Serialize Object To Xml File

Generic XML serialization of any object (or TPersistent/TComponent descendant, as is more likely) would be considerably more ideal. I've looked into ObjectBinaryToText as well, but it seems rather fragile and I haven't got it working quite right as of yet. The format is also non-standard; once this is being done, XML makes more sense. I've also poked around in the extensive sourcesoap subdirectory (D6 Enterprise, from work View image: /infopop/emoticons/icon_wink.gif), but haven't found the magic bullet I'm looking for.
Serialize object to xml

Xml Serialize C# Class

Xml

C# Serialize To Xml

If anyone knows of a hidden VCL feature I might be able to adapt, or some set of components which addresses this want of mine, that would be awesome. Thanks in advance View image: /infopop/emoticons/icon_smile.gif