Einzelnen Beitrag anzeigen

arnof

Registriert seit: 25. Apr 2013
1.252 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#3

AW: komische XML auslesen

  Alt 17. Jul 2018, 10:10
Dank für den Hilfe, ich habe es aber nun, wie es geht:

Delphi-Quellcode:
  XMLDocument1.Active:=False;
  XMLDocument1.XML.Text:=xml;
  XMLDocument1.Active:=True;
  LNodeElement := XMLDocument1.ChildNodes.FindNode('artlist');
  if (LNodeElement <> nil) then begin
    LNode:=LNodeElement.ChildNodes.First;
    TGrid_ArtList.RowCount:=LNodeElement.ChildNodes.Count+1;
    zeile:=1;
    while LNode<>nil do begin
       s:= LNode.NodeName;
       if (LNode.HasAttribute('eid')) then begin
        LAttrValue := LNode.Attributes['eid'];
        TGrid_ArtList.Cells[1,zeile]:=LAttrValue;
       end;
       if (LNode.HasAttribute('fab')) then begin
        LAttrValue := LNode.Attributes['fab'];
        TGrid_ArtList.Cells[2,zeile]:=LAttrValue;
       end;
       if zeile<LNodeElement.ChildNodes.Count then begin
        LNode := LNodeElement.ChildNodes.Get(Zeile);
       end else LNode:=nil;
       inc(zeile);
    end;
  end;
  XMLDocument1.Active:=False;
  Mit Zitat antworten Zitat