Salome HOME
CCAR:
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Handler.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
23 //  File   : SALOME_ModuleCatalog_Handler.cxx
24 //  Author : Estelle Deville
25 //  Module : SALOME
26 //  $Header$ 
27 //
28 #define WRITE_CATA_COMPONENT
29
30 #include "SALOME_ModuleCatalog_Handler.hxx"
31 #include "SALOME_ModuleCatalog_Parser_IO.hxx"
32 #include "utilities.h"
33
34 #include <sstream>
35 using namespace std;
36
37 #ifdef _DEBUG_
38 static int MYDEBUG = 0;
39 #else
40 static int MYDEBUG = 0;
41 #endif
42
43 //----------------------------------------------------------------------
44 // Function : SALOME_ModuleCatalog_Handler
45 // Purpose  : Constructor
46 //----------------------------------------------------------------------
47 SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& pathList,
48                                                            ParserComponents& moduleList,
49                                                            ParserTypes& typeMap,
50                                                            TypeList& typeList):_typeMap(typeMap),_typeList(typeList),
51                                                                                _pathList(pathList),_moduleList(moduleList)
52
53 {
54   if(MYDEBUG) BEGIN_OF("SALOME_ModuleCatalog_Handler");
55
56   // XML Tags initialisation
57   // Used in the function endElement
58   test_path_prefix_name     = "path-prefix-name";
59   test_computer_name        = "computer-name" ;
60   test_computer_list        = "computer-list" ;
61   test_path_prefix          = "path-prefix" ;
62   test_path_prefix_list     = "path-prefix-list" ;
63
64   test_component_name       = "component-name";
65   test_component_username   = "component-username";
66   test_component_type       = "component-type" ;
67   test_component_multistudy = "component-multistudy";
68   test_component_icon       = "component-icone" ;
69   test_component_impltype   = "component-impltype";
70   test_component_implname   = "component-implname";
71   test_component_version    = "component-version";
72   test_component_comment    = "component-comment";
73
74   test_interface_name       = "component-interface-name" ;
75   
76   test_service_name         = "service-name";
77   test_defaultservice       = "service-by-default";
78
79   test_typeofnode           = "type-of-node";
80
81   test_inParameter_type     = "inParameter-type";
82   test_inParameter_name     = "inParameter-name";
83   test_inParameter          = "inParameter";
84   test_inParameter_list     = "inParameter-list";
85
86   test_outParameter_type    = "outParameter-type";
87   test_outParameter_name    = "outParameter-name";
88   test_outParameter         = "outParameter";
89   test_outParameter_list    = "outParameter-list";
90
91   test_inDataStreamParameter_type = "inParameter-type";
92   test_inDataStreamParameter_name = "inParameter-name";
93   test_inDataStreamParameter_dependency = "inParameter-dependency";
94   test_inDataStreamParameter = "inParameter";
95   test_inDataStreamParameter_list = "DataStream-list";
96
97   test_outDataStreamParameter_type = "outParameter-type";
98   test_outDataStreamParameter_name = "outParameter-name";
99   test_outDataStreamParameter_dependency = "outParameter-dependency";
100   test_outDataStreamParameter = "outParameter";
101   test_outDataStreamParameter_list = "DataStream-list";
102
103   test_service =  "component-service";
104   test_service_list = "component-service-list";
105   test_interface_list = "component-interface-list";
106
107   test_constraint = "constraint";
108
109   test_component_list = "component-list";
110   test_component="component";
111
112   if(MYDEBUG) END_OF("SALOME_ModuleCatalog_Handler");
113 }
114
115 //----------------------------------------------------------------------
116 // Function : ~SALOME_ModuleCatalog_Handler
117 // Purpose  : Destructor
118 //----------------------------------------------------------------------
119 SALOME_ModuleCatalog_Handler::~SALOME_ModuleCatalog_Handler()
120 {
121   if(MYDEBUG) BEGIN_OF("~SALOME_ModuleCatalog_Handler()")
122   if(MYDEBUG) END_OF("~SALOME_ModuleCatalog_Handler()")
123 }
124
125
126 //=============================================================================
127 /*!
128  *  Processes XML document and fills the list of modules
129  */ 
130 //=============================================================================
131
132 void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
133 {
134   if(MYDEBUG) MESSAGE("Begin parse document");
135   // Empty the private elements
136   _pathList.resize(0);
137   _pathPrefix.listOfComputer.resize(0);
138   _serviceList.resize(0);
139   _interfaceList.resize(0);
140   _moduleList.resize(0);
141   _inDataStreamParamList.resize(0);
142   _outDataStreamParamList.resize(0);
143   _inParamList.resize(0);
144   _outParamList.resize(0);
145
146   // Get the document root node
147   xmlNodePtr aCurNode = xmlDocGetRootElement(theDoc);
148   aCurNode = aCurNode->xmlChildrenNode;
149   
150   // Processing the document nodes
151   while(aCurNode != NULL)
152   {
153     // Part 1: Process path prefix list (tag test_path_prefix_list)
154     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_path_prefix_list) )
155     {
156       xmlNodePtr aCurSubNode = aCurNode->xmlChildrenNode;
157       while(aCurSubNode != NULL)
158       {
159         // Forming a PathPrefix structure (tag test_path_prefix)
160         if ( xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_path_prefix) ) {
161           aCurSubNode = aCurSubNode->next;
162           continue;
163         }
164
165         xmlNodePtr aCurSubSubNode = aCurSubNode->xmlChildrenNode;
166         while(aCurSubSubNode != NULL)
167         {
168           // Tag test_path_prefix_name
169           if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_path_prefix_name) ) {
170             xmlChar* aPath = xmlNodeGetContent(aCurSubSubNode);
171             if (aPath != NULL) {
172               _pathPrefix.path = (const char*)aPath;
173               xmlFree(aPath);
174             }
175           }
176
177           // Tag test_computer_list
178           if ( !xmlStrcmp(aCurSubSubNode->name, (const xmlChar*)test_computer_list) ) {
179             xmlNodePtr aComputerNode = aCurSubSubNode->xmlChildrenNode;
180             while (aComputerNode != NULL) {
181               // Tag test_computer_name
182               if ( !xmlStrcmp(aComputerNode->name, (const xmlChar*) test_computer_name) ) {
183                 xmlChar* aCompName = xmlNodeGetContent(aComputerNode);
184                 if (aCompName != NULL) {
185                   _pathPrefix.listOfComputer.push_back((const char*)aCompName);
186                   xmlFree(aCompName);
187                 }
188               }
189
190               aComputerNode = aComputerNode->next;
191             }
192           }
193
194           aCurSubSubNode = aCurSubSubNode->next;
195         }
196
197         _pathList.push_back(_pathPrefix);
198         _pathPrefix.listOfComputer.resize(0);
199
200         aCurSubNode = aCurSubNode->next;
201       }
202     }
203
204     //Part 2: Process list of types
205     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)"type-list") )
206       {
207         xmlNodePtr aTypeNode = aCurNode->xmlChildrenNode;
208         while (aTypeNode != NULL)
209           {
210             //  match "type"
211             if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"type" )) 
212               {
213                 // Here is a basic type description
214                 ParserType aType;
215                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
216                 if(name)
217                   {
218                     aType.name = (const char*)name;
219                     xmlFree(name);
220                   }
221                 xmlChar *kind=xmlGetProp(aTypeNode,(const xmlChar*)"kind");
222                 if(kind)
223                   {
224                     aType.kind = (const char*)kind;
225                     xmlFree(kind);
226                   }
227                 if(aType.kind == "double" ||
228                    aType.kind == "int"    ||
229                    aType.kind == "bool"    ||
230                    aType.kind == "string")
231                   {
232                     if ( _typeMap.find(aType.name) == _typeMap.end() )
233                       {
234                         MESSAGE("Registered basic type: " << aType.name << " " << aType.kind );
235                         _typeMap[aType.name]=aType;
236                         _typeList.push_back(aType);
237                       }
238                     else
239                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
240                   }
241                 else
242                   std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") has incorrect kind, it will be ignored." << std::endl;
243               }
244             else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"sequence" )) 
245               {
246                 // Here is a sequence type description
247                 ParserSequence aType;
248                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
249                 if(name)
250                   {
251                     aType.name = (const char*)name;
252                     xmlFree(name);
253                   }
254                 xmlChar *content=xmlGetProp(aTypeNode,(const xmlChar*)"content");
255                 if(content)
256                   {
257                     aType.content = (const char*)content;
258                     xmlFree(content);
259                   }
260                 if ( _typeMap.find(aType.content) != _typeMap.end() )
261                   {
262                     if ( _typeMap.find(aType.name) == _typeMap.end() )
263                       {
264                         MESSAGE("Registered sequence type: " << aType.name << " " << aType.content );
265                         _typeMap[aType.name]=aType;
266                         _typeList.push_back(aType);
267                       }
268                     else
269                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
270                   }
271                 else
272                   {
273                     std::cerr << "Warning: this sequence type (" << aType.name << "," << aType.content << ") has unknown content type, it will be ignored." << std::endl;
274                   }
275               }
276             else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"objref" )) 
277               {
278                 // Here is an objref type description
279                 ParserObjref aType;
280                 int error=0;
281                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
282                 if(name)
283                   {
284                     aType.name = (const char*)name;
285                     xmlFree(name);
286                   }
287                 xmlChar *id=xmlGetProp(aTypeNode,(const xmlChar*)"id");
288                 if(id)
289                   {
290                     aType.id = (const char*)id;
291                     xmlFree(id);
292                   }
293
294                 xmlNodePtr aTypeSubNode = aTypeNode->xmlChildrenNode;
295                 while (aTypeSubNode != NULL)
296                   {
297                     if ( !xmlStrcmp(aTypeSubNode->name, (const xmlChar*)"base" )) 
298                       {
299                         //a base type
300                         xmlChar* content = xmlNodeGetContent(aTypeSubNode);
301                         if(content)
302                           {
303                             std::string base=(const char*)content;
304                             xmlFree(content);
305                             if ( _typeMap.find(base) != _typeMap.end() && _typeMap[base].kind == "objref")
306                               {
307                                 aType.bases.push_back(base);
308                               }
309                             else
310                               {
311                                 std::cerr << "Warning: this objref type (" << aType.name << ") has unknown base type (" << base << "), it will be ignored." << std::endl;
312                                 error=1;
313                                 break;
314                               }
315                           }
316                       }
317                     aTypeSubNode = aTypeSubNode->next;
318                   }
319                 if(!error)
320                   {
321                     if ( _typeMap.find(aType.name) == _typeMap.end() )
322                       {
323                         MESSAGE("Registered objref type: " << aType.name << " " << aType.id );
324                         _typeMap[aType.name]=aType;
325                         _typeList.push_back(aType);
326                       }
327                     else
328                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
329                   }
330               }
331             else if ( !xmlStrcmp(aTypeNode->name, (const xmlChar*)"struct" )) 
332               {
333                 // Here is a struct type description
334                 ParserStruct aType;
335                 int error=0;
336                 xmlChar * name=xmlGetProp(aTypeNode,(const xmlChar*)"name");
337                 if(name)
338                   {
339                     aType.name = (const char*)name;
340                     xmlFree(name);
341                   }
342                 xmlChar *id=xmlGetProp(aTypeNode,(const xmlChar*)"id");
343                 if(id)
344                   {
345                     aType.id = (const char*)id;
346                     xmlFree(id);
347                   }
348
349                 xmlNodePtr aTypeSubNode = aTypeNode->xmlChildrenNode;
350                 while (aTypeSubNode != NULL)
351                   {
352                     if ( !xmlStrcmp(aTypeSubNode->name, (const xmlChar*)"member" )) 
353                       {
354                         std::pair<std::string,std::string> member;
355                         xmlChar * m_name=xmlGetProp(aTypeSubNode,(const xmlChar*)"name");
356                         if(m_name)
357                           {
358                             member.first=(const char*)m_name;
359                             xmlFree(m_name);
360                           }
361                         xmlChar * m_type=xmlGetProp(aTypeSubNode,(const xmlChar*)"type");
362                         if(m_type)
363                           {
364                             member.second=(const char*)m_type;
365                             xmlFree(m_type);
366                           }
367                         if ( _typeMap.find(member.second) != _typeMap.end() )
368                           {
369                             aType.members.push_back(member);
370                           }
371                         else
372                           {
373                             std::cerr << "Warning: this struct type (" << aType.name << ") has unknown member type (" << member.first << "," << member.second << "), it will be ignored." << std::endl;
374                             error=1;
375                             break;
376                           }
377                       }
378                     aTypeSubNode = aTypeSubNode->next;
379                   }
380                 if(!error)
381                   {
382                     if ( _typeMap.find(aType.name) == _typeMap.end() )
383                       {
384                         MESSAGE("Registered struct type: " << aType.name << " " << aType.id );
385                         _typeMap[aType.name]=aType;
386                         _typeList.push_back(aType);
387                       }
388                     else
389                       std::cerr << "Warning: this type (" << aType.name << "," << aType.kind << ") already exists, it will be ignored."  << std::endl;
390                   }
391               } // end of struct
392             aTypeNode = aTypeNode->next;
393           }
394       }
395
396     //Part 3: Process list of components (tag test_component_list)
397     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_component_list) )
398     {
399       xmlNodePtr aComponentNode = aCurNode->xmlChildrenNode;
400       while (aComponentNode != NULL)
401       {
402         // Do not process tags differ from test_component here
403         if ( xmlStrcmp(aComponentNode->name, (const xmlChar*)test_component) ) {
404           aComponentNode = aComponentNode->next;
405           continue;
406         }
407
408         // Component identification
409
410         // Empty temporary structures
411         _aModule.name = "";
412         _aModule.constraint = "";
413         _aModule.icon="";       
414         _aModule.interfaces.resize(0);
415         _aModule.implementationType ="";
416         _aModule.implementationName ="";
417
418         xmlNodePtr aComponentSubNode = aComponentNode->xmlChildrenNode;
419         while(aComponentSubNode != NULL)
420         {
421           xmlChar* aNodeContent = xmlNodeGetContent(aComponentSubNode);
422
423           if (aNodeContent == NULL) {
424             aComponentSubNode = aComponentSubNode->next;
425             continue;
426           }
427
428           std::string aContent = (const char*)aNodeContent;
429
430           // Tag test_component_name
431           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_name) )
432             _aModule.name = aContent;
433
434           // Tag test_component_username
435           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_username) )
436             _aModule.username = aContent;
437
438           // Tag test_component_type
439           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_type) ) {
440             std::string aType = aContent;
441
442             if ((aType.compare("MESH") == 0) ||
443                 (aType.compare("Mesh") == 0) ||
444                 (aType.compare("mesh") == 0))
445               _aModule.type = MESH ;
446             else if((aType.compare("MED") == 0) ||
447                     (aType.compare("Med") == 0) ||
448                     (aType.compare("med") == 0))
449               _aModule.type = Med ;
450             else if((aType.compare("GEOM") == 0) ||
451                     (aType.compare("Geom") == 0) ||
452                     (aType.compare("geom") == 0))
453               _aModule.type = GEOM ;
454             else if((aType.compare("SOLVER") == 0) ||
455                     (aType.compare("Solver") == 0) ||
456                     (aType.compare("solver") == 0))
457               _aModule.type = SOLVER ;
458             else if((aType.compare("SUPERV") == 0) ||
459                     (aType.compare("Superv") == 0) ||
460                     (aType.compare("Supervision") == 0) ||
461                     (aType.compare("superv") == 0))
462               _aModule.type = SUPERV ;
463             else if((aType.compare("DATA") == 0) ||
464                     (aType.compare("Data") == 0) ||
465                     (aType.compare("data") == 0))
466               _aModule.type = DATA ; 
467             else if((aType.compare("VISU") == 0) ||
468                     (aType.compare("Visu") == 0) ||
469                     (aType.compare("visu") == 0))
470               _aModule.type = VISU ; 
471             else if((aType.compare("OTHER") == 0) ||
472                     (aType.compare("Other") == 0) ||
473                     (aType.compare("other") == 0))                
474               _aModule.type = OTHER ;
475             else
476               // If it'not in all theses cases, the type is affected to OTHER
477               _aModule.type = OTHER ;
478           }
479
480           // Tag test_component_multistudy
481           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
482             _aModule.multistudy = atoi( aContent.c_str() );
483
484           // Tag test_component_impltype
485           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
486             _aModule.implementationType = aContent;
487
488           // Tag test_component_implname
489           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_implname) )
490             _aModule.implementationName = aContent;
491
492           // Tag test_component_icon
493           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_icon) )
494             _aModule.icon = aContent;
495
496           // Tag test_component_version
497           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_version) )
498             _aModule.version = aContent;
499
500           // Tag test_component_comment
501           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_comment) )
502             _aModule.comment = aContent;
503
504           // Tag test_constraint
505           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_constraint) )
506             _aModule.constraint = aContent;
507
508           xmlFree(aNodeContent);
509
510           // Process tag test_interface_list:
511           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_interface_list) ) {
512
513             // Form an interface list for the component
514             xmlNodePtr aSubNode = aComponentSubNode->xmlChildrenNode;
515             while(aSubNode != NULL) {
516               // Tag test_interface_name
517               if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_interface_name) ) {
518                 xmlChar* anInterfaceName = xmlNodeGetContent(aSubNode);
519                 if (anInterfaceName != NULL) {
520                   _aInterface.name = (const char*)anInterfaceName;
521                   xmlFree(anInterfaceName);
522                 }
523               }
524
525               // Tag test_service_list
526               if ( !xmlStrcmp(aSubNode->name, (const xmlChar*)test_service_list) ) {
527                 // Form a service list for the interface
528                 xmlNodePtr aCompServiceNode = aSubNode->xmlChildrenNode;
529                 while(aCompServiceNode != NULL) {
530                   // Tag test_service
531                   if ( !xmlStrcmp(aCompServiceNode->name, (const xmlChar*)"component-service") ) {
532                     xmlNodePtr aCompServiceSubNode = aCompServiceNode->xmlChildrenNode;
533                     while(aCompServiceSubNode != NULL)
534                     {
535                       xmlChar* aCompServiceData = xmlNodeGetContent(aCompServiceSubNode);
536
537                       if ( aCompServiceData != NULL)
538                       {
539                         // Tag test_service_name
540                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_service_name) )
541                           _aService.name = (const char*)aCompServiceData;
542
543                         // Tag test_defaultservice
544                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) )
545                           _aService.byDefault = (const char*)aCompServiceData;
546
547                         // Tag test_typeofnode
548                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) )
549                           _aService.typeOfNode = (const char*)aCompServiceData;
550
551                         xmlFree(aCompServiceData);
552                       }
553
554                       // Tag test_inParameter_list
555                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inParameter_list) ) {
556                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
557                         while (aParamNode != NULL)
558                         {
559                           // Tag test_inParameter
560                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inParameter)) {
561                             aParamNode = aParamNode->next;
562                             continue;
563                           }
564
565                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
566                           while (aParamItemNode != NULL)
567                           {
568                             xmlChar* aParamData = xmlNodeGetContent(aParamItemNode);
569
570                             if (aParamData != NULL)
571                             {
572                               // Tag test_inParameter_name
573                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_name) )
574                                 _inParam.name = (const char*)aParamData;
575
576                               // Tag test_inParameter_type
577                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inParameter_type) )
578                                 _inParam.type = (const char*)aParamData;
579
580                               xmlFree(aParamData);
581                             }
582
583                             aParamItemNode = aParamItemNode->next;
584                           }
585
586                           _inParamList.push_back(_inParam) ; 
587
588                           // Empty temporary structures
589                           _inParam.type = "";
590                           _inParam.name = "";
591
592                           aParamNode = aParamNode->next;
593                         }
594
595                         _aService.inParameters = _inParamList;
596                         _inParamList.resize(0);
597                       }
598
599                       // Tag test_outParameter_list
600                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outParameter_list) ) {
601                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
602                         while (aParamNode != NULL)
603                         {
604                           // Tag test_outParameter
605                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outParameter)) {
606                             aParamNode = aParamNode->next;
607                             continue;
608                           }
609
610                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
611                           while (aParamItemNode != NULL)
612                           {
613                             xmlChar* anOutParamData = xmlNodeGetContent(aParamItemNode);
614
615                             if (anOutParamData != NULL)
616                             {
617                               // Tag test_outParameter_name
618                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_name) )
619                                 _outParam.name = (const char*)anOutParamData;
620
621                               // Tag test_outParameter_type
622                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outParameter_type) )
623                                 _outParam.type = (const char*)anOutParamData;
624
625                               xmlFree(anOutParamData);
626                             }
627
628                             aParamItemNode = aParamItemNode->next;
629                           }
630
631                           _outParamList.push_back(_outParam) ; 
632
633                           // Empty temporary structures
634                           _outParam.type = "";
635                           _outParam.name = "";
636
637                           aParamNode = aParamNode->next;
638                         }
639
640                         _aService.outParameters = _outParamList;
641                         _outParamList.resize(0);
642                       }
643
644                       //@ Tag test_inDataStreamParameter_list
645                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_inDataStreamParameter_list) )
646                       {
647                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
648                         while (aParamNode != NULL)
649                         {
650                           // Tag test_inDataStreamParameter
651                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_inDataStreamParameter)) {
652                             aParamNode = aParamNode->next;
653                             continue;
654                           }
655
656                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
657                           while (aParamItemNode != NULL)
658                           {
659                             xmlChar* inDataStreamParamData = xmlNodeGetContent(aParamItemNode);
660
661                             if (inDataStreamParamData != NULL)
662                             {
663                               // Tag test_inDataStreamParameter_name
664                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_name) )
665                                 _inDataStreamParam.name = (const char*)inDataStreamParamData;
666
667                               // Tag test_inDataStreamParameter_type
668                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_type) )
669                                 _inDataStreamParam.type = (const char*)inDataStreamParamData;
670
671                               // Tag test_inDataStreamParameter_dependency
672                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_inDataStreamParameter_dependency) )
673                                 _inDataStreamParam.dependency = (const char*)inDataStreamParamData;
674
675                               xmlFree(inDataStreamParamData);
676                             }
677
678                             aParamItemNode = aParamItemNode->next;
679                           }
680
681                           _inDataStreamParamList.push_back(_inDataStreamParam) ; 
682
683                           // Empty temporary structures
684                           _inDataStreamParam.type = "";
685                           _inDataStreamParam.name = "";
686                           _inDataStreamParam.dependency = "";
687
688                           aParamNode = aParamNode->next;
689                         }
690
691                         _aService.inDataStreamParameters = _inDataStreamParamList;
692                         _inDataStreamParamList.resize(0);
693                       }
694
695                       // Tag test_outDataStreamParameter_list
696                       if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_outDataStreamParameter_list) )
697                       {
698                         xmlNodePtr aParamNode = aCompServiceSubNode->xmlChildrenNode;
699                         while (aParamNode != NULL)
700                         {
701                           // Tag test_outDataStreamParameter
702                           if (xmlStrcmp(aParamNode->name, (const xmlChar*)test_outDataStreamParameter)) {
703                             aParamNode = aParamNode->next;
704                             continue;
705                           }
706
707                           xmlNodePtr aParamItemNode = aParamNode->xmlChildrenNode;
708                           while (aParamItemNode != NULL)
709                           {
710                             xmlChar* outDataStreamParamData = xmlNodeGetContent(aParamItemNode);
711
712                             if (outDataStreamParamData != NULL)
713                             {
714                               // Tag test_outDataStreamParameter_name
715                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_name) )
716                                 _outDataStreamParam.name = (const char*)outDataStreamParamData;
717                               
718                               // Tag test_outDataStreamParameter_type
719                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_type) )
720                                 _outDataStreamParam.type = (const char*)outDataStreamParamData;
721                               
722                               // Tag test_outDataStreamParameter_dependency
723                               if ( !xmlStrcmp(aParamItemNode->name, (const xmlChar*)test_outDataStreamParameter_dependency) )
724                                 _outDataStreamParam.dependency = (const char*)outDataStreamParamData;
725                               
726                               xmlFree(outDataStreamParamData);
727                             }
728
729                             aParamItemNode = aParamItemNode->next;
730                           }
731                           
732                           _outDataStreamParamList.push_back(_outDataStreamParam) ; 
733                           
734                           // Empty temporary structures
735                           _outDataStreamParam.type = "";
736                           _outDataStreamParam.name = "";
737                           _outDataStreamParam.dependency = "";
738
739                           aParamNode = aParamNode->next;
740                         }
741                         
742                         _aService.outDataStreamParameters = _outDataStreamParamList;
743                         _outDataStreamParamList.resize(0);
744                       }
745                       
746                       aCompServiceSubNode = aCompServiceSubNode->next;
747                     }
748
749                     // Put formed service into the list
750                     _serviceList.push_back(_aService);
751
752                     // Empty temporary structures
753                     _aService.name = "";
754                     _aService.typeOfNode = 1;
755                     _aService.inParameters.resize(0);
756                     _aService.outParameters.resize(0);
757                     _aService.inDataStreamParameters.resize(0);
758                     _aService.outDataStreamParameters.resize(0);
759                   }
760                   
761                   aCompServiceNode = aCompServiceNode->next;
762                 }
763                 
764                 _aInterface.services = _serviceList ;
765                 
766                 // Empty temporary structures
767                 _serviceList.resize(0);
768                 _interfaceList.push_back(_aInterface);  
769                 _aInterface.name ="";    
770                 _aInterface.services.resize(0);
771               }
772               
773               aSubNode = aSubNode->next;
774             }
775             
776             _aModule.interfaces = _interfaceList ;
777             _interfaceList.resize(0);
778           }
779
780           aComponentSubNode = aComponentSubNode->next;
781         }
782
783         _moduleList.push_back(_aModule);
784
785         aComponentNode = aComponentNode->next;
786       }
787     }
788
789     aCurNode = aCurNode->next;
790   }
791 }