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 28 29 30 31 32 33 34 35
| //voici la portion de mon code qui fuit
xpathRes = xmlXPathEvalExpression("/LOT/DOCUMENT", ctxt); // récupere tout les noeud documents
char ttt[90];
char tableauNom[10000][50];
// Manipulation du résultat
if (xpathRes->type == XPATH_NODESET) {
for (i = 0; i < xpathRes->nodesetval->nodeNr; i++) {
xmlNodePtr n = xpathRes->nodesetval->nodeTab[i]; // les noeuds sont dans la varible n
if (atoi( xmlGetProp(n, "NBImg")) != 0){
for( j = 0 ; j<atoi( xmlGetProp(n, "NBImg")) ; j++){
strcpy (ttt, "" );
strcat(ttt, repertoireArrive );
strcat(ttt, "/" );
strcat(ttt, fichier );
strcat(ttt, "/" );
strcat(ttt, xmlGetProp(n->children, "Nom") );
strcpy(tableauNom[j],ttt);
n->children = n->children->next;
}
strcpy(Nomfichier , LienRepertoireSortie );
strcat(Nomfichier , "/");
sprintf(nom,"%d",i);
strcat(Nomfichier , nom);
strcat(Nomfichier , ".tif");
}
}
}
//libéraTTTTION del memoire
xmlXPathFreeContext(ctxt);
xmlXPathFreeObject(xpathRes);
xmlFreeDoc(doc); |
Partager