void crerxmlfichier1::write_simple_doc2(int n,int m ) { // same as write_simple_doc1 but add each node // as early as possible into the tree. TiXmlDocument doc; TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); doc.LinkEndChild( decl ); TiXmlElement * root = new TiXmlElement( "TestPlan" ); doc.LinkEndChild( root ); int k=0; for (int i = 0; i <n; i++){ TiXmlElement * em = new TiXmlElement( "Testeur" ); root->LinkEndChild( em ); ++k; char f[50]; sprintf(f, "%s%d", "N", k); em->SetAttribute("Node", f); k=i+1; char j[50]; sprintf(j, "%s%d", "T", k); em->SetAttribute("id", j); } dump_to_stdout( &doc ); doc.SaveFile( "appsettings.xml" ); }
doc.SaveFile("C:/Users/abdelhalim/Documents/appsettings.xml");
doc.SaveFile("appsettings.xml");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)