Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2014.03.16;
Скачать: CL | DM;

Вниз

XML DOM   Найти похожие ветки 

 
x86   (2013-05-30 11:17) [0]

никак не разберусь с DOM, как создать такую структуру:


<files>
<file name="" size=""/>
</files>



var
 xml: IXMLDOMDocument;
begin
 xml := CoDOMDocument.Create;
 xml.documentElement := xml.createElement("files");
 // ...
 ShowMessage(xml.text);


 
Cobalt ©   (2013-05-30 13:44) [1]

xml.documentElement.AddChild + F1


 
x86   (2013-05-30 16:32) [2]

так не проходит:


var
 doc: IXMLDOMDocument;
 node1: IXMLDOMElement;
begin
 doc := CoDOMDocument.Create;
 node1 := doc.createElement("files");
 doc.documentElement. appendChild(node1); // <- Access Violation
 ShowMessage(doc.text);
end;


 
brother ©   (2013-05-30 16:39) [3]

а [1] не получилось?


 
Ega23 ©   (2013-05-30 16:55) [4]


> так не проходит:

Конечно не проходит.


 
Медвежонок Пятачок ©   (2013-05-30 17:20) [5]

doc := CoDOMDocument.Create;
doc.loadXML("<files/>");
xRoot := doc.selectSingleNode("/files");
node:= xRoot.appendChild(doc.createElement("file"));
attr := node.attributes.setnamedItem(doc.createAttribute("size"));
attr.NodeValue := 666;



Страницы: 1 вся ветка

Текущий архив: 2014.03.16;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.004 c
2-1369751060
DanilTraum
2013-05-28 18:24
2014.03.16
Создание одного обработчика для всех BitBtn


15-1380110910
Kerk
2013-09-25 16:08
2014.03.16
Challenges and Opportunities for Windows Developers Going Mobile


2-1369241162
NikitaXY
2013-05-22 20:46
2014.03.16
Одномерный массив. Delphi )


2-1369242407
grinya
2013-05-22 21:06
2014.03.16
paintbox delphi


11-1250348579
Dy1
2009-08-15 19:02
2014.03.16
Obj и IsForm