1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
// Activer le document avant d'écrire dedans
DocumentXML->Active = true;
// Créer un noeud
_di_IXMLNode Noeud;
Noeud = DocumentXML->CreateNode(WideString("Noeud1"));
// Ajouter un attribut a ce noeud
Noeud->SetAttribute(WideString("Attribut1"), WideString("Valeur"));
// On ajoute le noeud (ici ce sera la racine, sinon
// tu appels ChildNodes->Add() du noeud auquel tu veux l'ajouter
DocumentXML->ChildNodes->Add(Logiciel);
// Enregistrer le fichier
DocumentXML->SaveToFile(CheminFichier);
// Vider un objet TXMLDocument
DocumentXML->XML->Clear(); |
Partager