Issue building an XML document using TXMLDocument

后端 未结 3 362
清歌不尽
清歌不尽 2021-01-12 06:44

I\'m new to delphi and now I have to read create an xml. my code is the following:

function foo.createXMLDocument(): TXMLDocument;
var
  res: TXMLDocument;
          


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 07:11

    In my similar implementation, I declare res as IXMLDocument instead of TXMLDocument.

    var
       XMLDoc: IXMLDocument;
    .
    .
       XMLDoc := TXMLDocument.Create(nil);
       XMLDoc.Active := True;
    .
    .
       XMLDoc.SaveToFile(Filename);
       XMLDoc.Active := False;
    

提交回复
热议问题