文件名称:delphi数据库导入导出XML
文件大小:290KB
文件格式:RAR
更新时间:2018-09-18 14:29:05
DELPHI XML
procedure TForm1.inxmlClick(Sender: TObject); var XMLDocument1: TXMLDocument; node, xm_node, xm_node_info, kb_node, kb_node_info: IXMLNode; I, j, n, m: Integer; str: string; begin memo2.Clear; XMLDocument1 := TXMLDocument.Create(application); XMLDocument1.LoadFromFile('C:\Users\Administrator\Desktop\test2\user.xml'); xm_node := XMLDocument1.documentElement.ChildNodes.FindNode('项目信息表'); Memo2.Lines.Add(''); Memo2.Lines.Add('项目信息表'); if xm_node <> nil then begin for I := 0 to xm_node.ChildNodes.Count - 1 do begin str := ''; for j := 0 to xm_node.ChildNodes[I].AttributeNodes.Count - 1 do begin if xm_node.ChildNodes[I].Attributes[xm_node.ChildNodes[I].AttributeNodes.Nodes[j].NodeName] <> '' then str := str + xm_node.ChildNodes[I].AttributeNodes.Nodes[j].NodeName + ':' + xm_node.ChildNodes[I].Attributes[xm_node.ChildNodes[I].AttributeNodes.Nodes[j].nodename] + ' ' else str := str + xm_node.ChildNodes[I].AttributeNodes.Nodes[j].NodeName + ': null ' // if xm_node.ChildNodes[I].ChildNodes.FindNode('子节点') <> nil then // Memo2.Lines.Add('子节点: ' + xm_node.ChildNodes[I].ChildNodes.FindNode('子节点').Text); end; Memo2.Lines.Add(str); end; end;
【文件预览】:
Project1.~dpr
Project1.exe
Project1.res
Unit1.~dfm
Unit1.dfm
Unit1.ddp
Project1.cfg
Unit1.pas
Unit1.~ddp
Project1.dpr
Project1.dof
Unit1.~pas
user.xml
Unit1.dcu