var
XmlFile: IXMLDocument;
i,a:Integer;
begin
XmlFile:= newXMLDocument;
CopyFile('D:\Werke\
GUI\
XML-Gen\Templates\uav1.xtop','D:\Werke\
GUI\
XML-Gen\Outputs\uav1.xtop',not true);
WriteLn('Load File');
XMLFile.LoadFromFile('D:\Werke\
GUI\
XML-Gen\Outputs\uav1.xtop');
WriteLn('Activate XMLDoc');
XMLFile.Active:= true;
writeln('Writing uav1.xtop');
for I := 1 to Length(input_csv)-1 do begin
XMLFile.DocumentElement.ChildNodes['tns:types'].ChildNodes[0].AddChild('tns:variable');
XMLFile.DocumentElement.ChildNodes['tns:types'].ChildNodes[0].ChildNodes[I-1].SetAttributeNS('name','',input_csv[I ,2]);
XMLFile.DocumentElement.ChildNodes['tns:types'].ChildNodes[0].ChildNodes[I-1].SetAttributeNS('type','',input_csv[I ,0]);
end;
{...}
XMLFile.SaveToFile('D:\Werke\
GUI\
XML-Gen\Outputs\uav1_som.xml');
WriteLn('uav1_som.xml has been written');
WriteLn('Ready');
end;