XML Mapping Tool Delphi Tokyo

0

I would like to know how to map a .XML by Delphi Tokyo with the xml mapping tool and read in ClientDataSet .

Using the XML Mapping Tool with Delphi 7 I can do the mapping and read the files by ClientDataSet

if OpenDialog1.Execute then
     begin
         XMLTransform1.SourceXmlFile:= OpenDialog1.FileName;
         XMLTransform1.TransformationFile:= ExtractFilePath(ParamStr(0))+ 'transformation.xtr';
         Cds_Fornecedor.XMLData:= XMLTransform1.Data;
     end;

When you pass the line:

  

Cds_Format.XMLData: = XMLTransform1.Data;

Returns the following error:

  

XML PARSE ERROR:
  Reason: The System can not find the specified object.

Note: I generated schema.xml and .xtr for Delphi 7 and then generated it for Delphi Tokyo

    
asked by anonymous 10.07.2018 / 20:03

1 answer

0

I read an article on the net that the programmer used XMLTransformProvider in Delphi Tokyo instead of using XMLTransform (equal to Delphi 7 ). Then I changed the component and the code looks like this:

 If ClientDataSet1.Active then
    ClientDataSet1.Close;
 ClientDataSet1.providerName:= 'XMLTransformProvider1';

 XMLTransformProvider1.TransformRead.TransformationFile:= 'arquivo.xtr'
 XMLTransformProvider1.XMLDataFile:= OpenDialog1.FileName;
 ClientDataSet1.Active:= True;

I preferred to answer my own question instead of deleting it, because I know that if I had this difficulty, surely someone else will.

    
11.07.2018 / 15:23