Показать сообщение отдельно
  #2  
Старый 20.03.2018, 05:20
Аватар для Alegun
Alegun Alegun вне форума
LMD-DML
 
Регистрация: 12.07.2009
Адрес: Богородское
Сообщения: 3,025
Версия Delphi: D7E
Репутация: 1834
По умолчанию

Код:
procedure TForm1.Button1Click(Sender: TObject);
var
 i: integer;
begin
 XMLDocument1.LoadFromFile('D:\XML\1648.xml');
 XMLDocument1.Active:= true;
 with XMLDocument1.DocumentElement.ChildNodes['trk'].ChildNodes['trkseg'] do
  for i:= 0 to ChildNodes.Count-1 do
   begin
    StringGrid1.RowCount:= StringGrid1.RowCount+1;
    StringGrid1.Cells[0,StringGrid1.RowCount-1]:= ComboBox1.Text;
    StringGrid1.Cells[1,StringGrid1.RowCount-1]:= VarToStr(ChildNodes.Nodes[i].Attributes['lat']);
    StringGrid1.Cells[2,StringGrid1.RowCount-1]:= VarToStr(ChildNodes.Nodes[i].Attributes['lon']);
   end;
 XMLDocument1.Active:= false;
end;
Ответить с цитированием