Thema: Msxml

Einzelnen Beitrag anzeigen

MiniMax

Registriert seit: 15. Dez 2009
Ort: Bremen
193 Beiträge
 
Delphi 2009 Architect
 
#3

AW: Msxml

  Alt 13. Feb 2012, 09:48
wie meinst du das?

Code:
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;
Gruß
MiniMax
  Mit Zitat antworten Zitat