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