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