Autor Beitrag
Critter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 328
Erhaltene Danke: 3

Windows 7
Delphi 7 Pro.
BeitragVerfasst: Fr 17.09.04 09:31 
Hallo,

ich möchte gerne überprüfen, ob ein bestimmter Knoten in meinem XML-Dokument vorhanden ist. Leider finde ich keine einfache funktion dafür, muss ich tatsächlich alle Child Nodes durch iterrieren?

Gruß
Critter


Moderiert von user profile iconChristian S.: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am So 19.06.2005 um 13:15
stiftmaster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 149



BeitragVerfasst: So 19.06.05 12:09 
Hast du für dein Problem eine gute Lösung gefunden?
Ich hänge hier gerade vor dem gleichen Problem und bin auf der Suche.

Dankend

Stefan
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 19.06.05 12:16 
Mit was lest ihr die XML- Datei aus?

_________________
Programmers never die, they just GOSUB without RETURN
stiftmaster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 149



BeitragVerfasst: So 19.06.05 12:20 
Bei mir ist die XML-Datei auf der Festplatte gespeichert

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
  XML: IXMLDocument;
begin
  if not Assigned(XML) then
    XML := TXMLDocument.Create(nil);
  XML.Active := True;
  XML.Encoding := 'UTF-8';
  XML.NodeIndentStr := '  ';
  XML.Options := [doNodeAutoIndent];

  XML.LoadFromFile('d:/test.xml');

=> Finde Knoten in XML-File


Stefan
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 19.06.05 12:26 
user profile iconstiftmaster hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var
  XML: IXMLDocument;
begin
  if not Assigned(XML) then
    XML := TXMLDocument.Create(nil);

Kapier ichs net ganz. Iss das n Screibfehler?

Moderiert von user profile iconraziel: Color- durch Highlight-Tags ersetzt.

_________________
Programmers never die, they just GOSUB without RETURN
stiftmaster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 149



BeitragVerfasst: So 19.06.05 12:37 
ne, ist kein Schreibfehler. "IXMLDocument" ist ein Interface von Delphi 7, dass über eine TXMLDocument-Klasse initialisiert wird.

Das ganze läuft in einer Schleife ab und das XML-Interface soll nur dann erzeugt werden, wenn es noch nicht existiert. Daher:
if not Assigned(XML) then

Stefan
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 19.06.05 13:18 
Mach dich doch mal über Suche in: Delphi-Forum, Delphi-Library XPATH schlau. Das ist die einfachste Möglichkeit, einen bestimmten Knoten zu finden.