I will carefully say “No,” although I have no idea what you mean by “going through all the fields.”
Another answer refers to a workable way of repeating fields in your record using RTTI. Then you must make sure that your entries will not use any type that your RTTI-iterator code does not understand, or that it will not be saved.
Since “you don’t need to call AddChild yourself,” you can just store everything in XML attributes without any child nodes. I don’t know if you know about it, but there’s not only one way to map the fields in the record to the possible XML content that might turn out.
Here is an example entry:
TMyData = record Name:String; Age:Integer; Money:Double; end;
If you don’t want to call AddChild at all, you can simply write the attributes by creating one object as follows:
<MyData Name="Warren" Age="48" Money="100.00" />
Nobody says there that you should even use child nodes:
<MyData> <Name>Warren</Name> <Age>48</Age> <Money>100.00<Money/> </MyData>
So, it seems to me that you are avoiding the fact that XML provides you with many ways to do this, and that the MSXML DOM API, as an API, gives you several ways to map any record to a file.
Warren p
source share