//Button "Write to Database
procedure TForm1.Bt_savetodbClick(Sender: TObject);
var
zeilen,i,k:integer;
oldNode,newDLS,newDL,newSUB,newLink,newA:IXMLDOMNode;
begin
CreateOrOpenXML(fAppPath+Box_categ.Text+'
.xml');
zeilen:=XML_List.Items.Count;
oldNode:=xmlDoc.documentElement.parentNode;
xmlDoc.removeChild(oldNode);
xmlDoc.documentElement.removeChild(oldNode);
for i:=0
to zeilen
do
begin
newDLS:=xmlDoc.createElement('
dls');
newDL:=xmlDoc.createElement('
dl');
newSub := xmlDoc.createElement('
id');
newSub.text := IntToStr(i);
newDL.appendChild(newSub);
newSub := xmlDoc.createElement('
title');
newSub.text := XML_List.Items[i].SubItems[1];
newDL.appendChild(newSub);
newSub := xmlDoc.createElement('
bild');
newSub.text := XML_List.Items[i].SubItems[2];
newDL.appendChild(newSub);
newSub := xmlDoc.createElement('
beschreibung');
newSub.text := XML_List.Items[i].SubItems[3];
newDL.appendChild(newSub);
newSub := xmlDoc.createElement('
passwort');
newSub.text := XML_List.Items[i].SubItems[4];
newDL.appendChild(newSub);
newSub := xmlDoc.createElement('
download');
for k:=5
to XML_List.Items[i].SubItems.Count
do
begin
newLink:=xmlDoc.createElement('
links');
newA:=xmlDoc.createElement('
a');
newA.text:=XML_List.Items[i].SubItems[k];
newLink.appendChild(newA);
newSub.appendChild(newLink);
end;
newDL.appendChild(newSub);
newDLS.appendChild(newDL);
end;
xmlDoc.documentElement.appendChild(newDLS);
xmlDoc.save(fAppPath+Box_categ.Text+'
.xml');
end;