XML Mapper, ClientDataSets et al

2005-06-08 10:05:08 PM
Delphi 7 Enterprise, build 8.1 Windows XP spII
I have an xsd file from which I have created
XML file
Xtr files ToDP and ToXml
I need to populate the xml file according to the spec of the xsd file
automatically from our database and send the xml file as a string to 3rd
Party WebService.
I have built a client app that uses
XMLTransformProvider, TClientDataset
In code I lookup a customer number passed in as a parameter fill out the
relevant details of the xml file except for those that appear as Nested
Datasets in the xml.
Q1. How do I reference these? I cannot seem to get a handle on this at all.
Assuming that the XMLTransformProvider is doing its job with the rest of the
stuff, when I call ApplyUpdates(-1) , I get no errors but the resulting XML
file does not conform to the standard laid down by the xsd. in this respect
: If the xsd has say clients as an element and there are up to 4 of them
then the xml file has space in for client1, client2 etc. These are partially
filled in values, and the xsd complains that the value is incorrect.
Q2. How do I programmatically fill in the values of the clientDataset so
that only x (x is the number of records returned) are shown in the final
xml file.
Any help on any part would be appreciated.