+ xmlNodePtr aComponentNode = aCurNode->xmlChildrenNode;
+ while (aComponentNode != NULL)
+ {
+ // Do not process tags differ from test_component here
+ if ( xmlStrcmp(aComponentNode->name, (const xmlChar*)test_component) ) {
+ aComponentNode = aComponentNode->next;
+ continue;
+ }
+
+ // Component identification
+
+ // Empty temporary structures
+ _aModule.name = "";
+ _aModule.constraint = "";
+ _aModule.icon="";
+ _aModule.interfaces.resize(0);
+ _aModule.implementationType ="";
+ _aModule.implementationName ="";
+
+ xmlNodePtr aComponentSubNode = aComponentNode->xmlChildrenNode;
+ while(aComponentSubNode != NULL)
+ {
+ xmlChar* aNodeContent = xmlNodeGetContent(aComponentSubNode);
+
+ if (aNodeContent == NULL) {
+ aComponentSubNode = aComponentSubNode->next;
+ continue;
+ }
+
+ std::string aContent = (const char*)aNodeContent;
+
+ // Tag test_component_name
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_name) )
+ _aModule.name = aContent;
+
+ // Tag test_component_username
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_username) )
+ _aModule.username = aContent;
+
+ // Tag test_component_type
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_type) ) {
+ std::string aType = aContent;
+
+ if ((aType.compare("MESH") == 0) ||
+ (aType.compare("Mesh") == 0) ||
+ (aType.compare("mesh") == 0))
+ _aModule.type = MESH ;
+ else if((aType.compare("MED") == 0) ||
+ (aType.compare("Med") == 0) ||
+ (aType.compare("med") == 0))
+ _aModule.type = Med ;
+ else if((aType.compare("GEOM") == 0) ||
+ (aType.compare("Geom") == 0) ||
+ (aType.compare("geom") == 0))
+ _aModule.type = GEOM ;
+ else if((aType.compare("SOLVER") == 0) ||
+ (aType.compare("Solver") == 0) ||
+ (aType.compare("solver") == 0))
+ _aModule.type = SOLVER ;
+ else if((aType.compare("SUPERV") == 0) ||
+ (aType.compare("Superv") == 0) ||
+ (aType.compare("Supervision") == 0) ||
+ (aType.compare("superv") == 0))
+ _aModule.type = SUPERV ;
+ else if((aType.compare("DATA") == 0) ||
+ (aType.compare("Data") == 0) ||
+ (aType.compare("data") == 0))
+ _aModule.type = DATA ;
+ else if((aType.compare("VISU") == 0) ||
+ (aType.compare("Visu") == 0) ||
+ (aType.compare("visu") == 0))
+ _aModule.type = VISU ;
+ else if((aType.compare("OTHER") == 0) ||
+ (aType.compare("Other") == 0) ||
+ (aType.compare("other") == 0))
+ _aModule.type = OTHER ;
+ else
+ // If it'not in all theses cases, the type is affected to OTHER
+ _aModule.type = OTHER ;
+ }
+
+ // Tag test_component_multistudy
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
+ _aModule.multistudy = atoi( aContent.c_str() );
+
+ // Tag test_component_impltype
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
+ _aModule.implementationType = aContent;
+
+ // Tag test_component_implname
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_implname) )
+ _aModule.implementationName = aContent;
+
+ // Tag test_component_icon
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_icon) )
+ _aModule.icon = aContent;
+
+ // Tag test_component_version
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_version) )
+ _aModule.version = aContent;
+
+ // Tag test_component_comment
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_comment) )
+ _aModule.comment = aContent;
+
+ // Tag test_constraint
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_constraint) )
+ _aModule.constraint = aContent;
+
+ xmlFree(aNodeContent);
+
+ // Process tag test_interface_list:
+ if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_interface_list) ) {
+
+ // Form an interface list for the component
+ xmlNodePtr aSubNode = aComponentSubNode->xmlChildrenNode;
+ while(aSubNode != NULL) {
+ // Tag test_interface_name
+ if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_interface_name) ) {
+ xmlChar* anInterfaceName = xmlNodeGetContent(aSubNode);
+ if (anInterfaceName != NULL) {
+ _aInterface.name = (const char*)anInterfaceName;
+ xmlFree(anInterfaceName);
+ }
+ }
+
+ // Tag test_service_list
+ if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_service_list) ) {
+ // Form a service list for the interface
+ xmlNodePtr aCompServiceNode = aSubNode->xmlChildrenNode;
+ while(aCompServiceNode != NULL) {
+ // Tag test_service
+ if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)"component-service") ) {
+ xmlNodePtr aCompServiceSubNode = aCompServiceNode->xmlChildrenNode;
+ while(aCompServiceSubNode != NULL)
+ {
+ xmlChar* aCompServiceData = xmlNodeGetContent(aCompServiceSubNode);
+
+ if ( aCompServiceData != NULL)
+ {
+ // Tag test_service_name
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_service_name) )
+ _aService.name = (const char*)aCompServiceData;
+
+ // Tag test_defaultservice
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) )
+ _aService.byDefault = (const char*)aCompServiceData;
+
+ // Tag test_typeofnode
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) )
+ _aService.typeOfNode = (const char*)aCompServiceData;
+
+ xmlFree(aCompServiceData);
+ }
+
+ // Tag test_inParameter_list
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inParameter_list) ) {
+ xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
+ while (aParamNode != NULL)
+ {
+ // Tag test_inParameter
+ if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inParameter)) {
+ aParamNode = aParamNode->next;
+ continue;
+ }
+
+ xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
+ while (aParamItemNode != NULL)
+ {
+ xmlChar* aParamData = xmlNodeGetContent(aParamItemNode);
+
+ if (aParamData != NULL)
+ {
+ // Tag test_inParameter_name
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_name) )
+ _inParam.name = (const char*)aParamData;
+
+ // Tag test_inParameter_type
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_type) )
+ _inParam.type = (const char*)aParamData;
+
+ xmlFree(aParamData);
+ }
+
+ aParamItemNode = aParamItemNode->next;
+ }
+
+ _inParamList.push_back(_inParam) ;
+
+ // Empty temporary structures
+ _inParam.type = "";
+ _inParam.name = "";
+
+ aParamNode = aParamNode->next;
+ }
+
+ _aService.inParameters = _inParamList;
+ _inParamList.resize(0);
+ }
+
+ // Tag test_outParameter_list
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outParameter_list) ) {
+ xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
+ while (aParamNode != NULL)
+ {
+ // Tag test_outParameter
+ if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outParameter)) {
+ aParamNode = aParamNode->next;
+ continue;
+ }
+
+ xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
+ while (aParamItemNode != NULL)
+ {
+ xmlChar* anOutParamData = xmlNodeGetContent(aParamItemNode);
+
+ if (anOutParamData != NULL)
+ {
+ // Tag test_outParameter_name
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_name) )
+ _outParam.name = (const char*)anOutParamData;
+
+ // Tag test_outParameter_type
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_type) )
+ _outParam.type = (const char*)anOutParamData;
+
+ xmlFree(anOutParamData);
+ }
+
+ aParamItemNode = aParamItemNode->next;
+ }
+
+ _outParamList.push_back(_outParam) ;
+
+ // Empty temporary structures
+ _outParam.type = "";
+ _outParam.name = "";
+
+ aParamNode = aParamNode->next;
+ }
+
+ _aService.outParameters = _outParamList;
+ _outParamList.resize(0);
+ }
+
+ //@ Tag test_inDataStreamParameter_list
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inDataStreamParameter_list) )
+ {
+ xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
+ while (aParamNode != NULL)
+ {
+ // Tag test_inDataStreamParameter
+ if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inDataStreamParameter)) {
+ aParamNode = aParamNode->next;
+ continue;
+ }
+
+ xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
+ while (aParamItemNode != NULL)
+ {
+ xmlChar* inDataStreamParamData = xmlNodeGetContent(aParamItemNode);
+
+ if (inDataStreamParamData != NULL)
+ {
+ // Tag test_inDataStreamParameter_name
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_name) )
+ _inDataStreamParam.name = (const char*)inDataStreamParamData;
+
+ // Tag test_inDataStreamParameter_type
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_type) )
+ _inDataStreamParam.type = (const char*)inDataStreamParamData;
+
+ // Tag test_inDataStreamParameter_dependency
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_dependency) )
+ _inDataStreamParam.dependency = (const char*)inDataStreamParamData;
+
+ xmlFree(inDataStreamParamData);
+ }
+
+ aParamItemNode = aParamItemNode->next;
+ }
+
+ _inDataStreamParamList.push_back(_inDataStreamParam) ;
+
+ // Empty temporary structures
+ _inDataStreamParam.type = "";
+ _inDataStreamParam.name = "";
+ _inDataStreamParam.dependency = "";
+
+ aParamNode = aParamNode->next;
+ }
+
+ _aService.inDataStreamParameters = _inDataStreamParamList;
+ _inDataStreamParamList.resize(0);
+ }
+
+ // Tag test_outDataStreamParameter_list
+ if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outDataStreamParameter_list) )
+ {
+ xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
+ while (aParamNode != NULL)
+ {
+ // Tag test_outDataStreamParameter
+ if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outDataStreamParameter)) {
+ aParamNode = aParamNode->next;
+ continue;
+ }
+
+ xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
+ while (aParamItemNode != NULL)
+ {
+ xmlChar* outDataStreamParamData = xmlNodeGetContent(aParamItemNode);
+
+ if (outDataStreamParamData != NULL)
+ {
+ // Tag test_outDataStreamParameter_name
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_name) )
+ _outDataStreamParam.name = (const char*)outDataStreamParamData;
+
+ // Tag test_outDataStreamParameter_type
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_type) )
+ _outDataStreamParam.type = (const char*)outDataStreamParamData;
+
+ // Tag test_outDataStreamParameter_dependency
+ if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_dependency) )
+ _outDataStreamParam.dependency = (const char*)outDataStreamParamData;
+
+ xmlFree(outDataStreamParamData);
+ }
+
+ aParamItemNode = aParamItemNode->next;
+ }
+
+ _outDataStreamParamList.push_back(_outDataStreamParam) ;
+
+ // Empty temporary structures
+ _outDataStreamParam.type = "";
+ _outDataStreamParam.name = "";
+ _outDataStreamParam.dependency = "";
+
+ aParamNode = aParamNode->next;
+ }
+
+ _aService.outDataStreamParameters = _outDataStreamParamList;
+ _outDataStreamParamList.resize(0);
+ }
+
+ aCompServiceSubNode = aCompServiceSubNode->next;
+ }
+
+ // Put formed service into the list
+ _serviceList.push_back(_aService);
+
+ // Empty temporary structures
+ _aService.name = "";
+ _aService.typeOfNode = 1;
+ _aService.inParameters.resize(0);
+ _aService.outParameters.resize(0);
+ _aService.inDataStreamParameters.resize(0);
+ _aService.outDataStreamParameters.resize(0);
+ }
+
+ aCompServiceNode = aCompServiceNode->next;
+ }
+
+ _aInterface.services = _serviceList ;
+
+ // Empty temporary structures
+ _serviceList.resize(0);
+ _interfaceList.push_back(_aInterface);
+ _aInterface.name ="";
+ _aInterface.services.resize(0);
+ }
+
+ aSubNode = aSubNode->next;
+ }
+
+ _aModule.interfaces = _interfaceList ;
+ _interfaceList.resize(0);
+ }
+
+ aComponentSubNode = aComponentSubNode->next;
+ }
+
+ _moduleList.push_back(_aModule);
+
+ aComponentNode = aComponentNode->next;
+ }