Salome HOME
End of developpement/test of Switch Python Nodes
[modules/superv.git] / src / GraphBase / DataFlowBase_XmlHandler.cxx
1 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DataFlowBase_XmlHandler.cxx
25 //  Author : Arnaud RES
26 //  Module : SUPERV
27 //  $Header$
28
29 using namespace std;
30 #include "DataFlowBase_XmlHandler.hxx"
31
32 #include <qstring.h>
33 //#include <qxmlattributes.h>
34 #include <qxml.h>
35
36 #define TRACE 0
37
38 //static string NULLSTRING = string("") ;
39
40 GraphBase::XmlHandler::XmlHandler( CORBA::ORB_ptr Orb ,
41                                    const bool aConstructor ) :
42   _Orb( Orb ) , dataflowxml(false), depth(0), constructor(aConstructor) {
43   int i ;
44   for ( i = 0 ; i < maxlevel ; i++ ) {
45     fieldname[i] = NULLSTRING ;
46     fieldvalue[i] = NULLSTRING ;
47     step[i] = 0 ;
48   }
49   VXSize = 0 ;
50   GraphsNumber = 0 ;
51 }
52
53 GraphBase::XmlHandler::XmlHandler() {}
54
55 GraphBase::XmlHandler::~XmlHandler() {}
56
57 QString GraphBase::XmlHandler::errorProtocol() {
58   return errorProt;
59 }
60
61 bool GraphBase::XmlHandler::startDocument() {
62   MESSAGE( "====================startDocument " ) ;
63 // at the beginning of parsing: do some initialization
64   errorProt = "";
65   return TRUE;
66 }
67
68 bool GraphBase::XmlHandler::endDocument() {
69   MESSAGE( "====================endDocument " ) ;
70   return TRUE;
71 }
72
73 bool GraphBase::XmlHandler::startElement( const QString&, const QString&, 
74                                           const QString& qName, 
75                                           const QXmlAttributes& atts ) {
76   // do different actions depending on the name of the tag and the
77   // state you are in
78
79 #if TRACE
80   MESSAGE( "====================startElement " << depth << " " << qName)
81    
82 #endif
83
84   if ( ( qName == "dataflow" || qName == "supergraph" ) && depth == 0 ) {
85     // Dataflow detected
86     aListOfDataFlows.resize( GraphsNumber + 1 ) ;
87     int i ;
88     for ( i = 0 ; i < maxlevel ; i++ ) {
89       fieldname[i] = NULLSTRING ;
90       fieldvalue[i] = NULLSTRING ;
91       step[i] = 0 ;
92     }
93     VXSize = 0 ;
94     dataflowxml = TRUE;
95   }
96   if ( dataflowxml ) {
97     if ( qName == "supergraph" ) {
98       fieldname[depth] = qName.latin1() ;
99     }
100     else {
101       fieldname[depth++] = qName.latin1() ;
102     }
103   }
104   if ( depth == maxlevel+1 )
105     return false ;
106   return dataflowxml ;
107
108 }
109
110 static bool returnfalse( GraphBase::XmlHandler *myXmlHandler ,
111                          const char *msg ,
112                          const QString& qName ) {
113   MESSAGE( "returnfalse ERROR qName " << qName << " " << msg
114            << " fieldname " << myXmlHandler->getfieldname(myXmlHandler->getdepth())
115            << " fieldvalue '"
116            << myXmlHandler->getfieldvalue(myXmlHandler->getdepth()) << "'" )
117   return false ;
118 }
119
120 bool GraphBase::XmlHandler::endElement( const QString&,
121                                         const QString&,
122                                         const QString& qName) {
123
124   if ( qName == "supergraph" ) {
125 #if TRACE
126     MESSAGE( " ====================endElement supergraph" ) ;
127 #endif
128     return TRUE ;
129   }
130
131 // ERRORs :
132 // * On a eu endElement(dataflow)
133 // * Ou bien on a eu uniquement startElement(dataflow) et qName != fieldname et fieldvalue != NULLSTRING
134   if ( !dataflowxml ||
135        ( qName != QString( fieldname[depth].c_str() ) &&
136          fieldvalue[depth] != NULLSTRING ) ) {
137     MESSAGE( "endElement ERROR dataflowxml " << dataflowxml << " qName " << qName
138              << " fieldname[" << depth << "] "<< fieldname[depth] << " fieldvalue "
139              << fieldvalue[depth] )
140     return returnfalse( this , "top" , qName ) ;
141   }
142   if ( fieldvalue[depth] == NULLSTRING ) {
143     depth -= 1 ;
144   }
145
146 #if TRACE
147   MESSAGE( " ====================endElement step[" << depth << "]="
148            << step[depth] << " qName " << qName << " fieldvalue '"
149            << fieldvalue[depth] << "'")
150 #endif
151   switch ( depth ) {
152     case 0 : {
153       if ( step[depth] == 0 && qName == "dataflow" ) {
154         GraphsNumber += 1 ;
155         dataflowxml = false ;
156       }
157       else
158         return returnfalse( this , "depth0" , qName ) ;
159       break ;
160     }
161
162     case 1 : {
163       switch ( step[depth] ) {
164         case 0 :
165           if ( qName == "info-list" ) {
166 //            aListOfDataFlows[ GraphsNumber ].Info = aNode ;
167             step[depth]++ ;
168           }
169           else
170             return returnfalse( this , "depth1-0" , qName ) ;
171           break ;
172         case 1 :
173           if ( qName == "node-list" ) {
174 // node-list ok
175             step[depth]++ ;
176             step[3] = 16 ;
177             step[4] = 3 ;
178           }
179           else
180             return returnfalse( this , "depth1-1" , qName ) ;
181           break ;
182         case 2 :
183           if ( qName == "link-list" ) {
184             step[depth]++ ;
185           }
186           else
187             return returnfalse( this , "depth1-2" , qName ) ;
188           break ;
189         case 3 :
190           if ( qName == "data-list" ) {
191             step[depth]++ ;
192           }
193           else
194             return returnfalse( this , "depth1-3" , qName ) ;
195           break ;
196         default:
197           return returnfalse( this , "depth1-d" , qName ) ;
198           break ;
199         }
200       break ;
201     }
202
203     case 2 : {
204       switch ( step[depth] ) {
205         case 0 :
206           if ( qName == "node" ) {
207 // Node ok
208             if ( step[1] == 0 ) {
209               aListOfDataFlows[ GraphsNumber ].Info = aNode ;
210             }
211             else if ( step[1] == 1 ) {
212               int sizenode = aListOfDataFlows[ GraphsNumber ].Nodes.size() ;
213               aListOfDataFlows[ GraphsNumber ].Nodes.resize( sizenode+1 ) ;                
214               aListOfDataFlows[ GraphsNumber ].Nodes[ sizenode ] = aNode ;               
215             }
216             step[3] = 0 ;
217             aNode.theService.ServiceinParameter.length( 0 ) ;
218             aNode.theService.ServiceoutParameter.length( 0 ) ;
219             aNode.theListOfInDataStreams.resize( 0 ) ;
220             aNode.theListOfOutDataStreams.resize( 0 ) ;
221             aNode.theListOfFuncName.resize( 0 ) ;
222             aNode.theListOfPythonFunctions.resize( 0 ) ;
223             break ;
224           }
225           else if ( qName == "link" || qName == "data" ) {
226             step[depth]++ ;
227           }
228           else {
229             return returnfalse( this , "depth2-0" , qName ) ;
230             break ;
231           }
232         case 1 :
233           if ( qName == "link" ) {
234             int sizelink = aListOfDataFlows[ GraphsNumber ].Links.size() ;
235             aListOfDataFlows[ GraphsNumber ].Links.resize( sizelink+1 ) ;                
236             aListOfDataFlows[ GraphsNumber ].Links[ sizelink ] = aLink ;               
237             if ( VXSize ) {
238               aListOfDataFlows[ GraphsNumber ].Links[ sizelink ].aListOfCoords.resize( VXSize ) ;
239               int ic ;
240               for ( ic = 0 ; ic < VXSize ; ic++ ) {
241                 aListOfDataFlows[ GraphsNumber ].Links[ sizelink ].aListOfCoords[ ic ].theX = VX[ic] ;
242                 aListOfDataFlows[ GraphsNumber ].Links[ sizelink ].aListOfCoords[ ic ].theY = VY[ic] ;
243               }
244             }
245             VXSize = 0 ;
246             step[3] = 16 ;
247             break ;
248           }
249           else if ( qName == "data" ) {
250             step[depth]++ ;
251           }
252           else {
253             return returnfalse( this , "depth2-1" , qName ) ;
254             break ;
255           }
256         case 2 :
257           if ( qName == "data" ) {
258 // Data ok
259             if ( constructor ) {
260               int sizedata = aListOfDataFlows[ GraphsNumber ].Datas.size() ;
261               aListOfDataFlows[ GraphsNumber ].Datas.resize( sizedata+1 ) ;                
262               aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ] = aLink ;               
263               if ( VXSize ) {
264                 aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords.resize( VXSize ) ;
265                 int ic ;
266                 for ( ic = 0 ; ic < VXSize ; ic++ ) {
267                   aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords[ ic ].theX = VX[ic] ;
268                   aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords[ ic ].theY = VY[ic] ;
269                 }
270               }
271             }
272             VXSize = 0 ;
273             step[3] = 16 ;
274           }
275           else
276             return returnfalse( this , "depth2-2" , qName ) ;
277           break ;
278         default:
279           return returnfalse( this , "depth2-d" , qName ) ;
280           break ;
281         }
282       break ;
283     }
284
285     case 3 : {
286       switch ( step[depth] ) {
287         case 0 :
288           if ( qName == "component-name" ) {
289             if ( fieldvalue[depth] == NULLSTRING )
290               return returnfalse( this , "depth3-0" , qName ) ;
291             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
292               aNode.theComponentName = fieldvalue[depth].c_str() ;
293             else
294               aNode.theComponentName = "" ;
295             fieldvalue[depth] = NULLSTRING ;
296             step[depth]++ ;
297           }
298           else
299             return returnfalse( this , "depth3-0" , qName ) ;
300           break ;
301         case 1 :
302           if ( qName == "interface-name" ) {
303             if ( fieldvalue[depth] == NULLSTRING )
304               return returnfalse( this , "depth3-1" , qName ) ;
305             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
306               aNode.theInterfaceName = fieldvalue[depth].c_str() ;
307             else
308               aNode.theInterfaceName = "" ;
309             fieldvalue[depth] = NULLSTRING ;
310             step[depth]++ ;
311           }
312           else
313             return returnfalse( this , "depth3-1" , qName ) ;
314           break ;
315         case 2 :
316           if ( qName == "node-name" ) {
317             if ( fieldvalue[depth] == NULLSTRING )
318               return returnfalse( this , "depth3-2" , qName ) ;
319             aNode.theName = fieldvalue[depth].c_str() ;
320             fieldvalue[depth] = NULLSTRING ;
321             step[depth]++ ;
322           }
323           else
324             return returnfalse( this , "depth3-2" , qName ) ;
325           break ;
326         case 3 :
327           if ( qName == "kind" ) {
328             if ( fieldvalue[depth] == NULLSTRING )
329               return returnfalse( this , "depth3-3" , qName ) ;
330 // kind ok
331             sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theKind ) ;
332             fieldvalue[depth] = NULLSTRING ;
333             if ( aNode.theKind != SUPERV::DataStreamGraph ) {
334               step[depth]++ ;
335               step[4] = 0 ;
336             }
337             break ;
338           }
339           else if ( qName == "streamgraph-timeout" ) {
340             if ( fieldvalue[depth] == NULLSTRING )
341               return returnfalse( this , "depth3-3" , qName ) ;
342             sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theTimeout ) ;
343             fieldvalue[depth] = NULLSTRING ;
344 //              step[depth]++ ;
345 //              step[4] = 0 ;
346             break ;
347           }
348           else if ( qName == "streamgraph-datastreamtrace" ) {
349             if ( fieldvalue[depth] == NULLSTRING )
350               return returnfalse( this , "depth3-3" , qName ) ;
351             sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theDataStreamTrace ) ;
352             fieldvalue[depth] = NULLSTRING ;
353 //              step[depth]++ ;
354 //              step[4] = 0 ;
355             break ;
356           }
357           else if ( qName == "streamgraph-deltatime" ) {
358             if ( fieldvalue[depth] == NULLSTRING )
359               return returnfalse( this , "depth3-3" , qName ) ;
360             sscanf( fieldvalue[depth].c_str() ,"%lf" , (double * ) &aNode.theDeltaTime ) ;
361             fieldvalue[depth] = NULLSTRING ;
362             step[depth]++ ;
363             step[4] = 0 ;
364             break ;
365           }
366           else {
367             step[depth]++ ;
368             step[4] = 0 ;
369           }
370 //            return returnfalse( this , "depth3-3" , qName ) ;
371 //          break ;
372         case 4 :
373           if ( qName == "coupled-node" ) {
374             if ( fieldvalue[depth] == NULLSTRING )
375               return returnfalse( this , "depth3-4" , qName ) ;
376             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
377               aNode.theCoupledNode = fieldvalue[depth].c_str() ;
378             else
379               aNode.theCoupledNode = "" ;
380             fieldvalue[depth] = NULLSTRING ;
381             step[depth]++ ;
382             break ;
383           }
384           else
385             step[depth]++ ;
386 //            return returnfalse( this , "depth3-4" , qName ) ;
387 //          break ;
388         case 5 :
389           if ( qName == "service" ) {
390             if ( fieldvalue[depth] != NULLSTRING )
391               return returnfalse( this , "depth3-5" , qName ) ;
392             fieldvalue[depth] = NULLSTRING ;
393             step[depth]++ ;
394             step[4] = 6;
395             step[5] = 4 ;
396 // service ok
397           }
398           else
399             return returnfalse( this , "depth3-5" , qName ) ;
400           break ;
401         case 6 :
402           if ( qName == "DataStream-list" || qName == "Parameter-list" ) {
403             if ( fieldvalue[depth] != NULLSTRING )
404               return returnfalse( this , "depth3-6" , qName ) ;
405             fieldvalue[depth] = NULLSTRING ;
406             step[depth]++ ;
407             step[4] = 8 ;
408             step[5] = 8 ;
409 // Parameter-list ok
410           break ;
411           }
412           else
413             step[depth]++ ;
414             step[5] = 0 ;
415             step[6] = 0 ;
416 // NO Parameter-list
417 //            return returnfalse( this , "depth3-6" , qName ) ;
418 //          break ;
419         case 7 :
420           if ( qName == "PyFunction-list" ) {
421             if ( fieldvalue[depth] != NULLSTRING )
422               return returnfalse( this , "depth3-7" , qName ) ;
423             fieldvalue[depth] = NULLSTRING ;
424             step[depth]++ ;
425             step[5] = 0 ;
426             step[6] = 0 ;
427 // Parameter-list ok
428           break ;
429           }
430           else
431             step[depth]++ ;
432             step[5] = 0 ;
433             step[6] = 0 ;
434 // NO PyFunction-list
435 //            return returnfalse( this , "depth3-7" , qName ) ;
436 //          break ;
437         case 8 :
438           if ( qName == "creation-date" ) {
439             SUPERV::SDate D ;
440             char Date[23] ;
441             strcpy( Date , fieldvalue[depth].c_str() ) ;
442             int i ;
443             for ( i = 0 ; i < (int ) strlen(Date) ; i++ ) {
444               if ( Date[i] == '/' || Date[i] == '-' || Date[i] == ':' )
445                 Date[i] = ' ' ;
446             }
447 //            MESSAGE( "Date(" << Date << ")" );
448             int Day , Month , Year , Hour , Minute , Second ;
449             sscanf( Date ,"%d%d%d%d%d%d" , &Day ,
450                                            &Month ,
451                                            &Year ,
452                                            &Hour ,
453                                            &Minute ,
454                                            &Second ) ;
455             D.Day = Day ;
456             D.Month = Month ;
457             D.Year = Year ;
458             D.Hour = Hour ;
459             D.Minute = Minute ;
460             D.Second = Second ;
461             aNode.theFirstCreation = D ;
462             fieldvalue[depth] = NULLSTRING ;
463             step[depth]++ ;
464           }
465           else
466             return returnfalse( this , "depth3-8" , qName ) ;
467           break ;
468         case 9 :
469           if ( qName == "lastmodification-date" ) {
470             SUPERV::SDate D ;
471             char Date[23] ;
472             strcpy( Date , fieldvalue[depth].c_str() ) ;
473             int i ;
474             for ( i = 0 ; i < (int ) strlen(Date) ; i++ ) {
475               if ( Date[i] == '/' || Date[i] == '-' || Date[i] == ':' )
476                 Date[i] = ' ' ;
477             }
478 //            MESSAGE( "Date(" << Date << ")" );
479             int Day , Month , Year , Hour , Minute , Second ;
480             sscanf( Date ,"%d%d%d%d%d%d" , &Day ,
481                                            &Month ,
482                                            &Year ,
483                                            &Hour ,
484                                            &Minute ,
485                                            &Second ) ;
486             D.Day = Day ;
487             D.Month = Month ;
488             D.Year = Year ;
489             D.Hour = Hour ;
490             D.Minute = Minute ;
491             D.Second = Second ;
492             aNode.theLastModification = D ;
493             fieldvalue[depth] = NULLSTRING ;
494             step[depth]++ ;
495           }
496           else
497             return returnfalse( this , "depth3-9" , qName ) ;
498           break ;
499         case 10 :
500           if ( qName == "editor-release" ) {
501             aNode.theEditorRelease = fieldvalue[depth].c_str() ;
502             fieldvalue[depth] = NULLSTRING ;
503             step[depth]++ ;
504           }
505           else
506             return returnfalse( this , "depth3-10" , qName ) ;
507           break ;
508         case 11 :
509           if ( qName == "author" ) {
510             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
511               aNode.theAuthor = fieldvalue[depth].c_str() ;
512             else
513               aNode.theAuthor = "" ;
514             fieldvalue[depth] = NULLSTRING ;
515             step[depth]++ ;
516           }
517           else
518             return returnfalse( this , "depth3-11" , qName ) ;
519           break ;
520         case 12 :
521           if ( qName == "container" ) {
522             if ( fieldvalue[depth] == NULLSTRING )
523               return returnfalse( this , "depth3-12" , qName ) ;
524 // computer ok
525             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
526               aNode.theContainer = fieldvalue[depth].c_str() ;
527             else
528               aNode.theContainer = "" ;
529             fieldvalue[depth] = NULLSTRING ;
530             step[depth]++ ;
531           }
532           else
533             return returnfalse( this , "depth3-12" , qName ) ;
534           break ;
535         case 13 :
536           if ( qName == "comment" ) {
537             if ( fieldvalue[depth] == NULLSTRING )
538               return returnfalse( this , "depth3-13" , qName ) ;
539 // comment ok
540             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
541               aNode.theComment = fieldvalue[depth].c_str() ;
542             else
543               aNode.theComment = "" ;
544             fieldvalue[depth] = NULLSTRING ;
545             step[depth]++ ;
546           }
547           else
548             return returnfalse( this , "depth3-13" , qName ) ;
549           break ;
550         case 14 :
551           if ( qName == "x-position" ) {
552             if ( fieldvalue[depth] == NULLSTRING )
553               return returnfalse( this , "depth3-14" , qName ) ;
554             sscanf( fieldvalue[depth].c_str() , "%ld" , &aNode.theCoords.theX ) ;
555             fieldvalue[depth] = NULLSTRING ;
556             step[depth]++ ;
557 // x-position ok
558           }
559           else
560             return returnfalse( this , "depth3-14" , qName ) ;
561           break ;
562         case 15 :
563           if ( qName == "y-position" ) {
564             if ( fieldvalue[depth] == NULLSTRING )
565               return returnfalse( this , "depth3-15" , qName ) ;
566             sscanf( fieldvalue[depth].c_str() , "%ld" , &aNode.theCoords.theY ) ;
567             fieldvalue[depth] = NULLSTRING ;
568             step[depth]++ ;
569 // y-position ok
570           }
571           else
572             return returnfalse( this , "depth3-15" , qName ) ;
573           break ;
574         case 16 :
575           if ( qName == "fromnode-name" ) {
576             if ( fieldvalue[depth] == NULLSTRING )
577               return returnfalse( this , "depth3-16" , qName ) ;
578             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
579               aLink.FromNodeName = fieldvalue[depth].c_str() ;
580             else
581               aLink.FromNodeName = "" ;
582             fieldvalue[depth] = NULLSTRING ;
583             step[depth]++ ;
584             step[4] = 3 ;
585           }
586           else
587             return returnfalse( this , "depth3-16" , qName ) ;
588           break ;
589         case 17 :
590           if ( qName == "fromserviceparameter-name" ) {
591             if ( fieldvalue[depth] == NULLSTRING )
592               return returnfalse( this , "depth3-17" , qName ) ;
593             aLink.FromServiceParameterName = fieldvalue[depth].c_str() ;
594             fieldvalue[depth] = NULLSTRING ;
595             step[depth]++ ;
596           }
597           else
598             return returnfalse( this , "depth3-17" , qName ) ;
599           break ;
600         case 18 :
601           if ( qName == "tonode-name" ) {
602             if ( fieldvalue[depth] == NULLSTRING )
603               return returnfalse( this , "depth3-18" , qName ) ;
604             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
605               aLink.ToNodeName = fieldvalue[depth].c_str() ;
606             else
607               aLink.ToNodeName = "" ;
608             fieldvalue[depth] = NULLSTRING ;
609             step[depth]++ ;
610           }
611           else
612             return returnfalse( this , "depth3-18" , qName ) ;
613           break ;
614         case 19 :
615           if ( qName == "toserviceparameter-name" ) {
616             if ( fieldvalue[depth] == NULLSTRING )
617               return returnfalse( this , "depth3-19" , qName ) ;
618             aLink.ToServiceParameterName = fieldvalue[depth].c_str() ;
619             fieldvalue[depth] = NULLSTRING ;
620             step[depth]++ ;
621           }
622           else
623             return returnfalse( this , "depth3-19" , qName ) ;
624           step[5] = 2 ;
625           break ;
626         case 20 :
627           if ( qName == "data-value" ) {
628             if ( fieldvalue[depth] != NULLSTRING )
629               return returnfalse( this , "depth3-20" , qName ) ;
630 // data-value ok
631             step[depth]++ ;
632 //            step[4] = 3 ;
633             break ;
634           }
635           else
636             step[depth]++ ;
637 //            return returnfalse( this , "depth3-20" , qName ) ;
638 //          break ;
639         case 21 :
640           if ( qName == "coord-list" ) {
641             if ( fieldvalue[depth] != NULLSTRING )
642               return returnfalse( this , "depth3-21" , qName ) ;
643 // coord-list ok
644             step[depth] = 14 ;
645             step[4] = 5 ;
646           }
647           else
648             return returnfalse( this , "depth3-21" , qName ) ;
649           break ;
650         default:
651           return returnfalse( this , "depth3-d" , qName ) ;
652           break ;
653         }
654       break ;
655     }
656
657
658     case 4 : {
659       switch ( step[depth] ) {
660         case 0 :
661           if ( qName == "service-name" ) {
662             if ( fieldvalue[depth] == NULLSTRING )
663               return returnfalse( this , "depth4-0" , qName ) ;
664             if ( strcmp( fieldvalue[depth].c_str() , "?" ) )
665               aNode.theService.ServiceName = fieldvalue[depth].c_str() ;
666             else
667               aNode.theService.ServiceName = "" ;
668             aNode.theService.ServiceinParameter.length( 0 ) ;
669             aNode.theService.ServiceoutParameter.length( 0 ) ;
670             fieldvalue[depth] = NULLSTRING ;
671             step[depth]++ ;
672           }
673           else
674             return returnfalse( this , "depth4-0" , qName ) ;
675           break ;
676         case 1 :
677           if ( qName == "inParameter-list" ) {
678             if ( fieldvalue[depth] != NULLSTRING )
679               return returnfalse( this , "depth4-1" , qName ) ;
680             fieldvalue[depth] = NULLSTRING ;
681             step[depth]++ ;
682             step[5] = 1 ;
683             step[6] = 2 ; // First outParameter
684 // inParameterlist ok
685           }
686           else
687             return returnfalse( this , "depth4-1" , qName ) ;
688           break ;
689         case 2 :
690           if ( qName == "outParameter-list" ) {
691             if ( fieldvalue[depth] != NULLSTRING )
692               return returnfalse( this , "depth4-2" , qName ) ;
693             fieldvalue[depth] = NULLSTRING ;
694             step[depth] = 0 ;
695 // outParameterlist ok
696             step[5] = 0 ;
697             step[6] = 0 ;
698           }
699           else
700             return returnfalse( this , "depth4-2" , qName ) ;
701           break ;
702         case 3 :
703           if ( qName == "value-type" ) {
704             if ( fieldvalue[depth] == NULLSTRING )
705               return returnfalse( this , "depth4-3" , qName ) ;
706             int Kind ;
707             sscanf( fieldvalue[depth].c_str() , "%d" , &Kind ) ;
708 //            switch ( D.Value.type()->kind() ) {
709             aLink.aLinkValue = CORBA::Any() ;
710             switch ( Kind ) {
711             case CORBA::tk_string: {
712               aLink.aLinkValue <<= (char *) NULL ;
713               char * t;
714               aLink.aLinkValue >>= t;
715 #if TRACE
716               MESSAGE( t << " (string)" );
717 #endif
718               break;
719             }
720             case CORBA::tk_double: {
721               aLink.aLinkValue <<= (double ) 0. ;
722               double d;
723               aLink.aLinkValue >>= d;
724 #if TRACE
725               MESSAGE( d << " (double)" );
726 #endif
727               break;
728             }
729             case CORBA::tk_long: {
730               aLink.aLinkValue <<= (long ) 0 ;
731               long l;
732               aLink.aLinkValue >>= l;
733 #if TRACE
734               MESSAGE( l << " (long)" );
735 #endif
736               break;
737             }
738             case CORBA::tk_objref: {
739 //              aLink.aLinkValue.replace(CORBA::_tc_Object, NULL);
740               aLink.aLinkValue <<= CORBA::Object::_nil() ;
741 #if TRACE
742               MESSAGE( " (object reference)" );
743 #endif
744               break;
745             }
746             default:
747               MESSAGE( "(other ERROR)" );
748             }
749             fieldvalue[depth] = NULLSTRING ;
750             step[depth]++ ;
751             break ;
752           }
753           else
754             step[depth]++ ;
755 //            return returnfalse( this , "depth4-3" , qName ) ;
756 //          break ;
757         case 4 :
758           if ( qName == "value" ) {
759             if ( fieldvalue[depth] == NULLSTRING )
760               return returnfalse( this , "depth4-4" , qName ) ;
761             if ( !strcmp( fieldvalue[depth].c_str() , "?" ) ) {
762               aLink.aLinkValue <<= "" ;
763             }
764             else {
765               switch ( aLink.aLinkValue.type()->kind() ) {
766               case CORBA::tk_string: {
767                 aLink.aLinkValue <<= fieldvalue[depth].c_str() ;
768                 char * t;
769                 aLink.aLinkValue >>= t;
770 #if TRACE
771                 MESSAGE( t << " (string)" );
772 #endif
773                 break;
774               }
775               case CORBA::tk_double: {
776                 double d;
777                 sscanf( fieldvalue[depth].c_str() , "%lf" , &d ) ;
778                 aLink.aLinkValue <<= d;
779 #if TRACE
780                 MESSAGE( d << " (double)" );
781 #endif
782                 break;
783               }
784               case CORBA::tk_long: {
785                 long l;
786                 sscanf( fieldvalue[depth].c_str() , "%ld" , &l ) ;
787                 aLink.aLinkValue <<= l;
788 #if TRACE
789                 MESSAGE( l << " (long)" );
790 #endif
791                 break;
792               }
793               case CORBA::tk_objref: {
794                 CORBA::Object_ptr ObjRef ;
795                 const char * IORObjRef = fieldvalue[depth].c_str() ;
796                 ObjRef = _Orb->string_to_object( IORObjRef ) ;
797                 aLink.aLinkValue <<= ObjRef;
798 #if TRACE
799                 MESSAGE( IORObjRef << "(object reference)" );
800 #endif
801                 break;
802               }
803               default: {
804                 aLink.aLinkValue <<= _Orb->string_to_object( fieldvalue[depth].c_str() ) ;
805                 MESSAGE( "(other ERROR)" );
806               }
807               }
808             }
809             fieldvalue[depth] = NULLSTRING ;
810             step[depth]++ ;
811             step[5] = 2 ;
812           break ;
813           }
814           else
815             step[depth]++ ;
816 //            return returnfalse( this , "depth4-4" , qName ) ;
817 //          break ;
818         case 5 :
819           if ( qName == "coord" ) {
820             if ( fieldvalue[depth] != NULLSTRING )
821               return returnfalse( this , "depth4-5" , qName ) ;
822             if ( VXSize == (int ) VX.size() ) {
823               VX.resize( VX.size() + 10 ) ;
824               VY.resize( VY.size() + 10 ) ;
825             }
826             VX[ VXSize ] = X ;
827             VY[ VXSize ] = Y ;
828             VXSize++ ;
829             step[5] = 2 ;
830           }
831           else
832             return returnfalse( this , "depth4-5" , qName ) ;
833           break ;
834         case 6 :
835           if ( qName == "inParameter" ) {
836             if ( fieldvalue[depth] != NULLSTRING )
837               return returnfalse( this , "depth4-6" , qName ) ;
838             int size = aNode.theListOfInDataStreams.size() ;
839             aNode.theListOfInDataStreams.resize( size+1 ) ;
840             aNode.theListOfInDataStreams[ size ] = anInDataStreamParameter ;
841             break ;
842 // One more aParameter input
843           }
844           else
845             step[depth]++ ;
846 //            return returnfalse( this , "depth4-6" , qName ) ;
847 //          break ;
848         case 7 :
849           if ( qName == "outParameter" ) {
850             if ( fieldvalue[depth] != NULLSTRING )
851               return returnfalse( this , "depth4-7" , qName ) ;
852             int size = aNode.theListOfOutDataStreams.size() ;
853             aNode.theListOfOutDataStreams.resize( size+1 ) ;
854             aNode.theListOfOutDataStreams[ size ] = anOutDataStreamParameter ;
855 // One more aParameter output
856             step[4] = 6 ;
857             step[5] = 4 ;
858           }
859           else
860             return returnfalse( this , "depth4-7" , qName ) ;
861           break ;
862         case 8 :
863           if ( qName == "PyFunction" ) {
864             if ( fieldvalue[depth] != NULLSTRING )
865               return returnfalse( this , "depth4-8" , qName ) ;
866 // One more PyFunction
867             step[4] = 8 ;
868             step[5] = 8 ;
869           }
870           else
871             return returnfalse( this , "depth4-8" , qName ) ;
872           break ;
873         default:
874           return returnfalse( this , "depth4-d" , qName ) ;
875           break ;
876         }
877       break ;
878     }
879
880
881     case 5 : {
882       switch ( step[depth] ) {
883         case 0 :
884           if ( qName == "inParameter" ) {
885             if ( fieldvalue[depth] != NULLSTRING )
886               return returnfalse( this , "depth5-0" , qName ) ;
887             fieldvalue[depth] = NULLSTRING ;
888             int size = aNode.theService.ServiceinParameter.length() ;
889             aNode.theService.ServiceinParameter.length( size+1 ) ;
890             aNode.theService.ServiceinParameter[size] = aParameter ;
891 // One more aParameter input
892             step[6] = 0 ; // Next one
893           }
894           else
895             return returnfalse( this , "depth5-0" , qName ) ;
896           break ;
897         case 1 :
898           if ( qName == "outParameter" ) {
899             if ( fieldvalue[depth] != NULLSTRING )
900               return returnfalse( this , "depth5-1" , qName ) ;
901             fieldvalue[depth] = NULLSTRING ;
902             int size = aNode.theService.ServiceoutParameter.length() ;
903             aNode.theService.ServiceoutParameter.length( size+1 ) ;
904             aNode.theService.ServiceoutParameter[size] = aParameter ;
905 // One more aParameter Output
906             step[6] = 2 ; // Next one
907           }
908           else
909             return returnfalse( this , "depth5-1" , qName ) ;
910           break ;
911         case 2 :
912           if ( qName == "x" ) {
913             if ( fieldvalue[depth] == NULLSTRING )
914               return returnfalse( this , "depth5-2" , qName ) ;
915             sscanf( fieldvalue[depth].c_str() , "%d" , &X ) ;
916             fieldvalue[depth] = NULLSTRING ;
917             step[depth]++ ;
918           }
919           else
920             return returnfalse( this , "depth5-2" , qName ) ;
921           break ;
922         case 3 :
923           if ( qName == "y" ) {
924             if ( fieldvalue[depth] == NULLSTRING )
925               return returnfalse( this , "depth5-3" , qName ) ;
926             sscanf( fieldvalue[depth].c_str() , "%d" , &Y ) ;
927             fieldvalue[depth] = NULLSTRING ;
928           }
929           else
930             return returnfalse( this , "depth5-3" , qName ) ;
931           break ;
932         case 4 :
933           if ( qName == "inParameter-type" ) {
934             if ( fieldvalue[depth] == NULLSTRING )
935               return returnfalse( this , "depth5-4" , qName ) ;
936             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parametertype ) ;
937             fieldvalue[depth] = NULLSTRING ;
938             step[depth]++ ;
939 #if TRACE
940   //cout << "InDataStreamParameter.inParameter-type " << anInDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]" << step[depth] << endl ;
941 #endif
942             break ;
943           }
944           else
945             step[depth] = 6 ;
946 //            return returnfalse( this , "depth5-4" , qName ) ;
947 //          break ;
948         case 5 :
949           if ( qName == "inParameter-name" ) {
950             if ( fieldvalue[depth] == NULLSTRING )
951               return returnfalse( this , "depth5-5" , qName ) ;
952             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
953               anInDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ;
954             }
955             else {
956               anInDataStreamParameter.theDataStreamParameter.Parametername = "" ;
957             }
958             fieldvalue[depth] = NULLSTRING ;
959 #if TRACE
960   //cout << "InDataStreamParameter.inParameter-name " << anInDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]" << step[depth] << endl ;
961 #endif
962 //            step[depth]++ ;
963 //            step[depth] = 4 ;
964             break ;
965           }
966           else if ( qName == "inParameter-dependency" ) {
967             if ( fieldvalue[depth] == NULLSTRING )
968               return returnfalse( this , "depth5-5" , qName ) ;
969             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parameterdependency ) ;
970             fieldvalue[depth] = NULLSTRING ;
971 #if TRACE
972   //cout << "InDataStreamParameter.inParameter-dependency " << anInDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]"
973   //               << step[depth] << endl ;
974 #endif
975 //            step[depth]++ ;
976 //            step[depth] = 4 ;
977             break ;
978           }
979           else if ( qName == "inParameter-schema" ) {
980             if ( fieldvalue[depth] == NULLSTRING )
981               return returnfalse( this , "depth5-5" , qName ) ;
982             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfSchema ) ;
983             fieldvalue[depth] = NULLSTRING ;
984 #if TRACE
985   //cout << "InDataStreamParameter.inParameter-schema " << anInDataStreamParameter.theKindOfSchema << " step[" << depth << "]"
986   //               << step[depth] << endl ;
987 #endif
988 //            step[depth]++ ;
989 //            step[depth] = 4 ;
990             break ;
991           }
992           else if ( qName == "inParameter-interpolation" ) {
993             if ( fieldvalue[depth] == NULLSTRING )
994               return returnfalse( this , "depth5-5" , qName ) ;
995             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfInterpolation ) ;
996             fieldvalue[depth] = NULLSTRING ;
997 #if TRACE
998   //cout << "InDataStreamParameter.inParameter-interpolation " << anInDataStreamParameter.theKindOfInterpolation << " step[" << depth << "]"
999   //               << step[depth] << endl ;
1000 #endif
1001 //            step[depth]++ ;
1002 //            step[depth] = 4 ;
1003             break ;
1004           }
1005           else if ( qName == "inParameter-extrapolation" ) {
1006             if ( fieldvalue[depth] == NULLSTRING )
1007               return returnfalse( this , "depth5-5" , qName ) ;
1008             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfExtrapolation ) ;
1009             fieldvalue[depth] = NULLSTRING ;
1010 //            step[depth]++ ;
1011             step[depth] = 4 ;
1012 #if TRACE
1013   //cout << "InDataStreamParameter.inParameter-extrapolation " << anInDataStreamParameter.theKindOfExtrapolation << " step[" << depth << "]"
1014   //               << step[depth] << endl ;
1015 #endif
1016             break ;
1017           }
1018 //          else
1019 //            return returnfalse( this , "depth5-5" , qName ) ;
1020 //          break ;
1021         case 6 :
1022           if ( qName == "outParameter-type" ) {
1023             if ( fieldvalue[depth] == NULLSTRING )
1024               return returnfalse( this , "depth5-6" , qName ) ;
1025             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parametertype ) ;
1026             fieldvalue[depth] = NULLSTRING ;
1027 //            step[depth]++ ;
1028             step[depth] = 7 ;
1029 #if TRACE
1030   //cout << "OutDataStreamParameter.outParameter-type " << anOutDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]"
1031   //               << step[depth] << endl ;
1032 #endif
1033           }
1034           else
1035             return returnfalse( this , "depth5-6" , qName ) ;
1036           break ;
1037         case 7 : 
1038           if ( qName == "outParameter-name" ) {
1039             if ( fieldvalue[depth] == NULLSTRING )
1040               return returnfalse( this , "depth5-7" , qName ) ;
1041             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
1042               anOutDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ;
1043             }
1044             else {
1045               anOutDataStreamParameter.theDataStreamParameter.Parametername = "" ;
1046             }
1047             fieldvalue[depth] = NULLSTRING ;
1048 #if TRACE
1049   //cout << "OutDataStreamParameter.outParameter-name " << anOutDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]"
1050   //               << step[depth] << endl ;
1051 #endif
1052 //            step[depth]++ ;
1053 //            step[depth] = 6 ;
1054           }
1055           else if ( qName == "outParameter-dependency" ) {
1056             if ( fieldvalue[depth] == NULLSTRING )
1057               return returnfalse( this , "depth5-7" , qName ) ;
1058             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parameterdependency ) ;
1059             fieldvalue[depth] = NULLSTRING ;
1060 #if TRACE
1061   //cout << "OutDataStreamParameter.outParameter-dependency " << anOutDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]"
1062   //               << step[depth] << endl ;
1063 #endif
1064 //            step[depth]++ ;
1065 //            step[depth] = 6 ;
1066           }
1067           else if ( qName == "outParameter-values" ) {
1068             if ( fieldvalue[depth] == NULLSTRING )
1069               return returnfalse( this , "depth5-7" , qName ) ;
1070             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theNumberOfValues ) ;
1071             fieldvalue[depth] = NULLSTRING ;
1072 //            step[depth]++ ;
1073             step[depth] = 6 ;
1074 #if TRACE
1075   //cout << "OutDataStreamParameter.outParameter-values " << anOutDataStreamParameter.theNumberOfValues << " step[" << depth << "]"
1076   //               << step[depth] << endl ;
1077 #endif
1078           }
1079           else
1080             return returnfalse( this , "depth5-7" , qName ) ;
1081           break ;
1082         case 8 :
1083           if ( qName == "FuncName" ) {
1084             if ( fieldvalue[depth] == NULLSTRING )
1085               return returnfalse( this , "depth5-8" , qName ) ;
1086             int l = aNode.theListOfFuncName.size() ;
1087             aNode.theListOfFuncName.resize( l+1 ) ;
1088             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
1089               aNode.theListOfFuncName[ l ] = fieldvalue[depth].c_str() ;
1090             }
1091             else {
1092               aNode.theListOfFuncName[ l ] = "" ;
1093             }
1094             aNode.theListOfPythonFunctions.resize( l+1 ) ;
1095             aNode.theListOfPythonFunctions[ l ] = new SUPERV::ListOfStrings() ;
1096 #if TRACE
1097             MESSAGE( " ==========theListOfFuncName/theListOfPythonFunctions size "
1098                      << l+1 )
1099 #endif
1100             fieldvalue[depth] = NULLSTRING ;
1101             step[depth]++ ;
1102           }
1103           else
1104             return returnfalse( this , "depth5-8" , qName ) ;
1105           break ;
1106         case 9 :
1107           if ( qName == "PyFunc" ) {
1108             if ( fieldvalue[depth] == NULLSTRING )
1109               return returnfalse( this , "depth5-9" , qName ) ;
1110             int l = aNode.theListOfPythonFunctions.size() - 1 ;
1111             SUPERV::ListOfStrings aPythonFunction = *aNode.theListOfPythonFunctions[ l ] ;
1112             int ll = aPythonFunction.length() ;
1113             aPythonFunction.length( ll+1 ) ;
1114             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
1115               aPythonFunction[ ll ] = fieldvalue[depth].c_str() ;
1116             }
1117             else {
1118               aPythonFunction[ ll ] = NULLSTRING ;
1119             }
1120             if ( ll ) {
1121               aNode.theListOfPythonFunctions.resize( l ) ;
1122               aNode.theListOfPythonFunctions.resize( l+1 ) ;
1123             }
1124             aNode.theListOfPythonFunctions[ l ] = new SUPERV::ListOfStrings( aPythonFunction ) ;
1125 #if TRACE
1126             MESSAGE( " ==========theListOfPythonFunctions[" << l << "] size " << ll+1
1127                      << " [" << ll << "] = " << aPythonFunction[ ll ] )
1128 #endif
1129             fieldvalue[depth] = NULLSTRING ;
1130 //            step[depth]++ ;
1131           }
1132           else
1133             return returnfalse( this , "depth5-9" , qName ) ;
1134           break ;
1135         default:
1136           return returnfalse( this , "depth5-d" , qName ) ;
1137           break ;
1138         }
1139       break ;
1140     }
1141
1142     case 6 : {
1143       switch ( step[depth] ) {
1144         case 0 :
1145           if ( qName == "inParameter-type" ) {
1146             if ( fieldvalue[depth] == NULLSTRING )
1147               return returnfalse( this , "depth6-0" , qName ) ;
1148             aParameter.Parametertype = fieldvalue[depth].c_str() ;
1149             fieldvalue[depth] = NULLSTRING ;
1150             step[depth]++ ;
1151           }
1152           else
1153             return returnfalse( this , "depth6-0" , qName ) ;
1154           break ;
1155         case 1 :
1156           if ( qName == "inParameter-name" ) {
1157             if ( fieldvalue[depth] == NULLSTRING )
1158               return returnfalse( this , "depth6-1" , qName ) ;
1159             aParameter.Parametername = fieldvalue[depth].c_str() ;
1160             fieldvalue[depth] = NULLSTRING ;
1161             step[depth]++ ;
1162           }
1163           else
1164             return returnfalse( this , "depth6-1" , qName ) ;
1165           break ;
1166         case 2 :
1167           if ( qName == "outParameter-type" ) {
1168             if ( fieldvalue[depth] == NULLSTRING )
1169               return returnfalse( this , "depth6-2" , qName ) ;
1170             aParameter.Parametertype = fieldvalue[depth].c_str() ;
1171             fieldvalue[depth] = NULLSTRING ;
1172             step[depth]++ ;
1173           }
1174           else
1175             return returnfalse( this , "depth6-2" , qName ) ;
1176           break ;
1177         case 3 :
1178           if ( qName == "outParameter-name" ) {
1179             if ( fieldvalue[depth] == NULLSTRING )
1180               return returnfalse( this , "depth6-3" , qName ) ;
1181             aParameter.Parametername = fieldvalue[depth].c_str() ;
1182             fieldvalue[depth] = NULLSTRING ;
1183             step[depth]++ ;
1184           }
1185           else
1186             return returnfalse( this , "depth6-3" , qName ) ;
1187           break ;
1188         default:
1189           return returnfalse( this , "depth6-d" , qName ) ;
1190           break ;
1191         }
1192       break ;
1193     }
1194   }
1195
1196 #if TRACE
1197   //cout << "return from endElement " << qName << " step[" << depth << "]" << step[depth] << endl ;
1198 #endif
1199   return TRUE;
1200 }
1201
1202
1203 bool GraphBase::XmlHandler::characters( const QString& ch ) {
1204   // we are not interested in whitespaces
1205   QString ch_simplified = ch.simplifyWhiteSpace();
1206   if ( ch_simplified.isEmpty() ) {
1207     return TRUE;
1208   }
1209   depth -= 1 ;
1210 #if TRACE
1211   MESSAGE( "characters step[" << depth << "]=" << step[depth]
1212        << " ch " << ch << " fieldvalue_must_be_NULL : '" << fieldvalue[depth] << "'" ) ;
1213 #endif
1214   if ( depth < 0 || fieldvalue[depth] != NULLSTRING )
1215     return returnfalse( this , "characters " , ch ) ;
1216
1217 //  fieldvalue[depth] = (const char * ) ch ;
1218   fieldvalue[depth] = ch.latin1() ;
1219   return TRUE;
1220 }
1221
1222
1223 QString GraphBase::XmlHandler::errorString() {
1224   //cout << "the document is not in the quote file format" << endl ;
1225   return "the document is not in the quote file format";
1226 }
1227
1228
1229 bool GraphBase::XmlHandler::fatalError( const QXmlParseException& exception ) {
1230   errorProt += QString( "fatal parsing error: %1 in line %2, column %3\n" )
1231     .arg( exception.message() )
1232     .arg( exception.lineNumber() )
1233     .arg( exception.columnNumber() );
1234   //cout << "GraphBase::XmlHandler::fatalError " << errorProt.latin1() << endl ;
1235   return QXmlDefaultHandler::fatalError( exception );
1236 }
1237
1238 #if 0
1239 SALOME_SuperVision::Date GraphBase::XmlHandler::StringToDate( QString& myStrDate) const
1240 {
1241   SALOME_SuperVision::Date aDate;
1242   QString qstrDate(myStrDate);
1243   QString qstrTemp;
1244
1245   // Date
1246   int iPos = qstrDate.find("/");
1247   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1248   aDate.Day = qstrTemp.toShort();
1249   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1250   iPos = qstrDate.find("/");
1251   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1252   aDate.Month = qstrTemp.toShort();
1253   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1254   iPos = qstrDate.find(" ");
1255   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1256   aDate.Year = qstrTemp.toShort();
1257
1258   // Time
1259   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1260   iPos = qstrDate.find(":");
1261   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1262   aDate.Hour = qstrTemp.toShort();
1263   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1264   iPos = qstrDate.find(":");
1265   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1266   aDate.Minute = qstrTemp.toShort();
1267   qstrDate = qstrDate.right(qstrDate.length()-iPos).stripWhiteSpace();
1268   aDate.Second = qstrDate.toShort();
1269
1270   return aDate;
1271 }
1272 #endif
1273
1274