unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XMLIntf, XMLDoc;
type
TForm1 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var xml : TXMLDocument;
CNode : IXMLNode;
CdNode : IXMLNode;
PNode : IXMLNode;
i,j,k : Integer;
begin
XML := TXMLDocument.Create(
nil);
XML.XML.Text := Memo1.Lines.Text;
XML.Options := [doNodeAutoCreate,doAutoSave];
XML.Active:=true;
for i:=0
to XML.ChildNodes.Count-1
do
begin
for j:=0
to XML.ChildNodes[i].ChildNodes.Count-1
do
begin
CdNode:=
XML.ChildNodes[i].ChildNodes[j];
if CdNode.NodeName='
computerdaten'
then begin
for k:=0
to CdNode.ChildNodes.Count-1
do
begin
PNode:=CdNode.ChildNodes[k];
if PNode.NodeName='
mainboard'
then ShowMessage(PNode.NodeValue);
// deine Variable
end;
end;
end;
end;
end;
end.