1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
DOMDoc := CoDOMDocument.Create;
with DOMDoc do begin
async := false;
DocumentElement := createElement('kml'); //création de l'élément racine
NodeAttribute := createAttribute('xmlns');
NodeAttribute.value := 'http://www.opengis.net/kml/2.2';
DocumentElement.Attributes.setNamedItem(NodeAttribute);
NodeAttribute := createAttribute('xmlns:gx');
NodeAttribute.value := 'http://www.google.com/kml/ext/2.2';
DocumentElement.Attributes.setNamedItem(NodeAttribute);
NodeAttribute := createAttribute('xmlns:kml');
NodeAttribute.value := 'http://www.opengis.net/kml/2.2';
DocumentElement.Attributes.setNamedItem(NodeAttribute);
NodeAttribute := createAttribute('xmlns:atom');
NodeAttribute.value := 'http://www.w3.org/2005/Atom';
DocumentElement.Attributes.setNamedItem(NodeAttribute);
NodeDoc := createNode('element','Document','');
documentElement.appendChild(NodeDoc);
Node := createNode('element','Name','');
NodeText := createTextNode('Test');
Node.appendChild(NodeText);
NodeDoc.appendChild(Node);
save(Test.kml);
end; |
Partager