var
f: TCharSetFile;
begin
if TntSaveDialog1.Execute then
begin
DataSet_backup.Data := song_dataSet.Data;
f := TcharSetFile.Create(TntSaveDialog1.FileName,csUtf8,True);
f.WriteLnW('<?xml version="1.0"
encoding="UTF-8"?>');
f.WriteLnW('<Tables>');
f.WriteLnW('<Song>');
DataSet_backup.First;
while not DataSet_backup.Eofdo
begin
f.WriteLnW('<Record>');
f.WriteLnW('<SongFileID>'+DataSet_backup.FieldByName('svcd_file_id').AsString+'</SongFileID>');
f.WriteLnW('<SongID>'+DataSet_backup.FieldByName('song_id').AsString+'</SongID>');
f.WriteLnW('<SongName>'+replace(DataSet_backup.FieldByName('Song_Name').Value)+'</SongName>');
f.WriteLnW('<SelectType>'+DataSet_backup.FieldByName('Is_Check').AsString+'</SelectType>');
f.WriteLnW('</Record>');
end;
DataSet_backup.Next;
end;
f.WriteLnW('</Song>');
DataSet_backup.Data := movie_dataset.Data;
DataSet_backup.First;
f.WriteLnW('<Movie>');
while not DataSet_backup.Eofdo
begin
if DataSet_backup.FieldByName('is_check').AsString='1' then
begin
f.WriteLnW('<Record>');
f.WriteLnW('<MovieID>'+DataSet_backup.FieldByName('movie_id').AsString+'</MovieID>');
f.WriteLnW('<MovieName>'+replace(DataSet_backup.FieldByName('movie_Name').Value)+'</MovieName>');
f.WriteLnW('</Record>');
end;
DataSet_backup.Next;
end;
f.WriteLnW('</Movie>');
f.WriteLnW('</Tables>');
f.Save;
FISChange := False;
ShowMessage('保存模板完毕!');
end;
end;