小编Abd*_*lam的帖子

如何在delphi中创建xml文件

我是delphi的新手,现在我必须阅读创建一个xml.我的代码如下:

unit writexml1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, xmldom, XMLIntf, StdCtrls, msxmldom, XMLDoc;

type
  TForm1 = class(TForm)
    XMLDocument1: TXMLDocument;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SaveClick(Sender: TObject);
var
  rootName: String;
  childNode: String;
  attrChild: string;
  iXml: IDOMDocument;
  iRoot, iNode, iNode2, iChild, iAttribute: IDOMNode;
  XMLDoc: TXMLDocument;
begin
  XMLDoc.Active := False;
  XMLDoc.XML.Text := '';
  XMLDoc.Active := True;
  XMLDoc.SaveToFile('C:\Documents and Settings\a\Desktop\zulfa.xml'); …
Run Code Online (Sandbox Code Playgroud)

delphi delphi-7

13
推荐指数
3
解决办法
4万
查看次数

标签 统计

delphi ×1

delphi-7 ×1