la fonction me permet de charger un document XML et d'effectuer une opération XPath, afin de récupérer les attributs d'un noeud.
Elle renvoie le résultat sous forme de structure (tTransmission).

J'aimerai savoir comme récupérer les éléments enfants (children) et leurs attributs.

struct tTransmission GetTransmission(char *id)
{
char *global_cfgfile; // fichier de configuration
tTransmission transmission; // transmission
char * attValue=NULL; // permet la récupération des attributs

// Génération de l'expression XPath pour noeud "get" en fonction de l'@id "trans"
char *XPathExp;
XPathExp = "//trans[@id=";
strcat(XPathExp, id);
strcat(XPathExp, "]/get");

//printf("%s\n",XPathExp);

int returnValue = 0;

// Initialisation et déclaration variables XML
xmlDoc *doc = NULL;
xmlXPathContextPtr xpathCtx = NULL;
xmlXPathObjectPtr xpathObj = NULL;

// Récupération chemin du fichier de config
if ((global_cfgfile = getenv(HOSADUPLIC_CFG)) == NULL) {
printf("error : HOSADUPLIC_CFG\n");
returnValue = -1;
goto end;
}

// chargement du fichier de configuration
doc = xmlReadFile(global_cfgfile, NULL, 0);
if (doc == NULL) {
printf("error: could not parse file %s\n", global_cfgfile);
returnValue = -1;
goto end;
}

// création du context XPath et évaluation de l'expression
xpathCtx = xmlXPathNewContext(doc);
xpathObj = xmlXPathEvalExpression(reinterpret_cast<xmlChar*>(XPathExp), xpathCtx);

attValue = (char *) xmlGetProp(xpathObj->nodesetval->nodeTab[0],(xmlChar *) "type");

transmission.id = id;
transmission.source.type = attValue;

end:
// on libére et on nettoie
xmlXPathFreeObject(xpathObj);
xmlXPathFreeContext(xpathCtx);
xmlFreeDoc(doc);
xmlCleanupParser();

return transmission;

}