Was Bernhard meint, ist das hier:
Delphi-Quellcode:
var
Stream1: TFileStream;
Stream2: TMemoryStream;
const
Head: AnsiString = '
<?xml version="1.0" encoding="UTF-8"?>';
// oder Encoding Windows-1252
begin
Stream1 := TFileStream.Create(DateiDatei, fmOpenRead
or fmShareDenyNone);
Stream2 := TMemoryStream.Create;
try
Stream2.
Write(Head[1], Length(Head));
Stream2.Copyfrom(Stream1, 0);
Stream2.Position := 0;
// bla
Xml.LoadFromStream(Stream2);
// bla
finally
Stream1.Free;
Stream2.Free;
end;
end;