views:

1279

answers:

4

I'm trying to save data in a TClientDataSet to an XML file, but it doesn't like some of my fields. The helpfile says to create a definition, in one of two ways: either with the xmlmapper.exe file in my \bin folder or with an IDOMDocument interface.

Problem is, xmlmapper.exe isn't there, and IDOMDocument is one of those annoying structures that Delphi 2009 was released without writing up documentation for. So I have to choose between a non-existent EXE or an interface with no documentation and no indication of which objects implement it or how to create them.

Does anyone know what I'm supposed to do in this case?

A: 

XMLMapper.exe is in my \bin directory, it is also under my tools menu (although I may have added it there. . . .) What edition of Delphi do you have? I looked at the feature matrix and I don't see anything that looks like it that isn't in all three editions. You might run your installation again and see if maybe you skipped the installation of it.

Jim McKeeth
Just checked. Only thing I skipped was the ribbon controls.
Mason Wheeler
A: 

You might look at some 3rd party Delphi books (Marco Cantu has a few) and see if they document IDOMDocument. You also might look around for some examples.

Jim McKeeth
A: 

Can't you just access the ClientDataSet.XMLData property and save that to a text file?

birger
Nope. XMLData is a computed property which uses the same conversion routine as SaveToFile, with the same limitations.
Mason Wheeler
+2  A: 

If you are using fields that are unsupported in delphi's XML serialisation, you need to create your own functions for XML loading/saving.

It's not hard, and it if you do it, that code can be expanded for other serialisation formats (JSON, CSV, XLSX, ...)

dmajkic
I'm sure it's not all that hard. I just don't know where to go about creating them.
Mason Wheeler