Using Delphi 2009, I'm trying to export the data from a delphi dataset to an XML file. See attached for the desired XML output. I'm after a generic solution here that can be used on other datasets in the future rather than something hard coded.
The catch is that the XML element names in the output file don't corresspond to dataset fieldnames...
So I was thinking something along the lines of a procedure where you pass in the dataset + something mapping dataset fieldnames to XML elements/attributes. See attached for what I had in mind for fieldname mapping - I've basically replaced the XML data contents with fieldnames. This is just an idea - I'm open to suggestions. This procedure would return the XML file (as per attached).
Does something like this already exist in Delphi? Sample code would be a great help.
Thanks in advance, all comments will be appreciated.