Je viens de faire un test rapide, en créant un fichier xml de la façon suivante :  
 
Code :
 - <test>
 - <balise val="1" champ="DATAFAISANT1MO"/>
 - <balise val="2" champ="DATAFAISANT1MO"/>
 - </test>
 
  | 
 
Puis j'ai testé (rapidement, regardez pas les non-tests, c'est juste pour un benchmark)
 
Code :
 - #define WIN32_LEAN_AND_MEAN
 - #include <windows.h>
 - #include "tinyxml.h"
 - int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
 - {
 -     TiXmlDocument doc;
 -     if (doc.LoadFile("test.xml.txt" )) {
 -         TiXmlElement *pNode = doc.FirstChildElement();
 -         TiXmlElement *pValNode = pNode->FirstChildElement("balise" );
 -         while (pValNode) {
 -             int val;
 -             pValNode->Attribute("val",&val);
 -             char szName[32];
 -             sprintf(szName,"%d.txt",val);
 -             FILE *f = fopen(szName,"wt" );
 -             if (f) {
 -                 fprintf(f,"%s",pValNode->Attribute("champ" ));
 -                 fclose(f);
 -             }
 -             pValNode=  pValNode->NextSiblingElement("balise" );
 -         }
 -     }
 -     // The user interface is a modal dialog box
 -     return 0;
 - }
 
  | 
 
voici le résultat d'exécution sous code-blocks :
 
 
Citation :
 
 
   Process returned 0 (0x0)   execution time : 0.194 s
 Press any key to continue.
 
   | 
 
 
Le fichier XML fait 2,33 MO. Les 2 fichiers 1.txt et 2.txt générés sont complets.
 
Message édité par xilebo le 31-07-2009 à 22:52:55