Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   bei XML Add - alles in einer "wurscht" (https://www.delphipraxis.net/163412-bei-xml-add-alles-einer-wurscht.html)

value is NULL 28. Sep 2011 09:10

bei XML Add - alles in einer "wurscht"
 
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!

FredlFesl 29. Sep 2011 08:02

AW: bei XML Add - alles in einer "wurscht"
 
Na ja, XML ist an sich unformatiert.
Wenn Du es hübsch haben willst, musst Du es hübsch machen, also formatieren.
GIDF

MarcoWarm 29. Sep 2011 08:16

AW: bei XML Add - alles in einer "wurscht"
 
Hallo,

das geht zum Beispiel so: http://www.delphipraxis.net/933572-post4.html

value is NULL 29. Sep 2011 10:31

AW: bei XML Add - alles in einer "wurscht"
 
aber ich benutze ja kein ixmldomdocument ... :(


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:25 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz