procedure MM(s:
String);
begin Form2.Memo1.lines.add(s);
end;
procedure MM2(s:
String);
begin Form2.Memo2.lines.add(s);
end;
function Extract_XMLAttribut2(aXML_File, start_Attributname:
string):
string;
//XML-Attribute auslesen
var i_start, i_end: Integer; zstr :
String;
begin
Result := '
';
i_start := Pos(start_Attributname, aXML_File);
if i_start > 0
then begin
i_start := i_start + Length(start_Attributname);
zstr := copy(aXML_File, i_start, 50);
// ist 50 der längste string?
i_end:= Pos('
"',zstr);
Result := copy(zstr, 1, i_end-1);
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
var str :
String;
begin
Memo1.Clear;
Memo1.Lines.LoadFromFile(ExtractFilePath(Application.ExeName)+'
test.xml');
str:= Extract_XMLAttribut2(Memo1.text, '
NAME="');
MM2(str);
str:= Extract_XMLAttribut2(Memo1.text, '
CHRISTIAN_NAME="');
MM2(str);
end;