首先你需要安装xml解析器,文件名为MSXML2_TLB.pas,
然后就可以定义dom的接口
构造一个类
**** = class
private
ddm : TDOMDocument;
iddm : IXMLDOMDocument;
public
//类构造函数
Constructor Create(xmlURL:string;Owner :TComponent);overload;//传入参数为xml文件路径
....(一系列的xml解析函数)
end;
implementation
{ Plug_InsInfoCls }
constructor Plug_InsInfoCls.Create(xmlURL: string;
Owner: TComponent);
begin
URL := xmlURL;
ddm := TDOMDocument.Create(Owner);
iddm := ddm.DefaultInterface;
iddm.async := false;
iddm.load(URL);
Root := iddm.documentElement;
end;