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