Einzelnen Beitrag anzeigen

value is NULL

Registriert seit: 10. Sep 2010
249 Beiträge
 
#1

bei XML Add - alles in einer "wurscht"

  Alt 28. Sep 2011, 08:10
Hi Leute

habe warscheinlich ein simples Problem, weiß aber gerade nicht wie ichs aus der Welt schaffen kann.

Ich habe in meinen Programm eine ADDtoXML Funktion in der ich eigentlich folgendes mache:

Delphi-Quellcode:
xmlnode := xml.ChildNodes.FindNode('voxctmodule_list');
newnode := XMLNode.AddChild('voxctmodule');
newnode.Attributes['servername'] := tools.GetMachineName;
newnode.Attributes['subtype'] := opt.getoptasstr('modulename');
newnode.Attributes['type'] := opt.getoptasstr('moduletype');
newnode.Attributes['moduleindex'] := opt.getoptasstr('moduleid');
newnode.Attributes['modulesubtype'] := opt.getoptasstr('modulesubtype');
xml.SaveToFile('C:\config.xml');
das ganze sieht dann abe rso aus:

Code:
<module_list>
   <module servername="WIN2K3-V3-3" type="msgmgr" moduleindex="0"/>
   <module servername="WIN2K3-V3-3" type="Mgr" moduleindex="101"/>
   <module subtype="Generic" servername="WIN2K3-V3-3" type="Rps" moduleindex="102"/>
   <module subtype="V3" servername="WIN2K3-V3-3" type="ACC" moduleindex="104"/>
   <module subtype="V3" servername="WIN2K3-V3-3" type="WebServer" moduleindex="110"/>
   <module subtype="ync" servername="WIN2K3-V3-3" type="system" moduleindex="200"/>
   <module subtype="stat" servername="WIN2K3-V3-3" type="system" moduleindex="201"/>
   <module subtype="State" servername="WIN2K3-V3-3" type="system" moduleindex="444"/>
   <module subtype="Update" servername="WIN2K3-V3-3" type="system" moduleindex="608"/>
   <module servername="WKS-IT-03" subtype="Archiv" type="System" moduleindex="701" modulesubtype=""/><module servername="WKS-IT-03" subtype="Archiv2" type="System" moduleindex="701" modulesubtype=""/></module_list>
Ich habe hier praktisch 2 neue module eingetragen (subtype Archiv) dh. 2 mal meine Funktion aufgerufen. Wie kann ich das den machen das ich das so wie die oberen Module aufgereiht habe?

LG und Danke!
  Mit Zitat antworten Zitat