Salome HOME
SMH: 3.0.0 preparation = merged version (POLYWORK + RTVDEBUG01) + adopation for new GUI
[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.Value = fieldvalue[depth].c_str() ;
763               aLink.aLinkValue = CORBA::Any() ; // ???
764             }
765             else {
766               switch ( aLink.aLinkValue.type()->kind() ) {
767               case CORBA::tk_string: {
768                 aLink.aLinkValue <<= fieldvalue[depth].c_str() ;
769                 char * t;
770                 aLink.aLinkValue >>= t;
771 #if TRACE
772                 MESSAGE( t << " (string)" );
773 #endif
774                 break;
775               }
776               case CORBA::tk_double: {
777                 double d;
778                 sscanf( fieldvalue[depth].c_str() , "%lf" , &d ) ;
779                 aLink.aLinkValue <<= d;
780 #if TRACE
781                 MESSAGE( d << " (double)" );
782 #endif
783                 break;
784               }
785               case CORBA::tk_long: {
786                 long l;
787                 sscanf( fieldvalue[depth].c_str() , "%ld" , &l ) ;
788                 aLink.aLinkValue <<= l;
789 #if TRACE
790                 MESSAGE( l << " (long)" );
791 #endif
792                 break;
793               }
794               case CORBA::tk_objref: {
795                 CORBA::Object_ptr ObjRef ;
796                 const char * IORObjRef = fieldvalue[depth].c_str() ;
797                 ObjRef = _Orb->string_to_object( IORObjRef ) ;
798                 aLink.aLinkValue <<= ObjRef;
799 #if TRACE
800                 MESSAGE( IORObjRef << "(object reference)" );
801 #endif
802                 break;
803               }
804               default: {
805                 aLink.aLinkValue <<= _Orb->string_to_object( fieldvalue[depth].c_str() ) ;
806                 MESSAGE( "(other ERROR)" );
807               }
808               }
809             }
810             fieldvalue[depth] = NULLSTRING ;
811             step[depth]++ ;
812             step[5] = 2 ;
813           break ;
814           }
815           else
816             step[depth]++ ;
817 //            return returnfalse( this , "depth4-4" , qName ) ;
818 //          break ;
819         case 5 :
820           if ( qName == "coord" ) {
821             if ( fieldvalue[depth] != NULLSTRING )
822               return returnfalse( this , "depth4-5" , qName ) ;
823             if ( VXSize == (int ) VX.size() ) {
824               VX.resize( VX.size() + 10 ) ;
825               VY.resize( VY.size() + 10 ) ;
826             }
827             VX[ VXSize ] = X ;
828             VY[ VXSize ] = Y ;
829             VXSize++ ;
830             step[5] = 2 ;
831           }
832           else
833             return returnfalse( this , "depth4-5" , qName ) ;
834           break ;
835         case 6 :
836           if ( qName == "inParameter" ) {
837             if ( fieldvalue[depth] != NULLSTRING )
838               return returnfalse( this , "depth4-6" , qName ) ;
839             int size = aNode.theListOfInDataStreams.size() ;
840             aNode.theListOfInDataStreams.resize( size+1 ) ;
841             aNode.theListOfInDataStreams[ size ] = anInDataStreamParameter ;
842             break ;
843 // One more aParameter input
844           }
845           else
846             step[depth]++ ;
847 //            return returnfalse( this , "depth4-6" , qName ) ;
848 //          break ;
849         case 7 :
850           if ( qName == "outParameter" ) {
851             if ( fieldvalue[depth] != NULLSTRING )
852               return returnfalse( this , "depth4-7" , qName ) ;
853             int size = aNode.theListOfOutDataStreams.size() ;
854             aNode.theListOfOutDataStreams.resize( size+1 ) ;
855             aNode.theListOfOutDataStreams[ size ] = anOutDataStreamParameter ;
856 // One more aParameter output
857             step[4] = 6 ;
858             step[5] = 4 ;
859           }
860           else
861             return returnfalse( this , "depth4-7" , qName ) ;
862           break ;
863         case 8 :
864           if ( qName == "PyFunction" ) {
865             if ( fieldvalue[depth] != NULLSTRING )
866               return returnfalse( this , "depth4-8" , qName ) ;
867 // One more PyFunction
868             step[4] = 8 ;
869             step[5] = 8 ;
870           }
871           else
872             return returnfalse( this , "depth4-8" , qName ) ;
873           break ;
874         default:
875           return returnfalse( this , "depth4-d" , qName ) ;
876           break ;
877         }
878       break ;
879     }
880
881
882     case 5 : {
883       switch ( step[depth] ) {
884         case 0 :
885           if ( qName == "inParameter" ) {
886             if ( fieldvalue[depth] != NULLSTRING )
887               return returnfalse( this , "depth5-0" , qName ) ;
888             fieldvalue[depth] = NULLSTRING ;
889             int size = aNode.theService.ServiceinParameter.length() ;
890             aNode.theService.ServiceinParameter.length( size+1 ) ;
891             aNode.theService.ServiceinParameter[size] = aParameter ;
892 // One more aParameter input
893             step[6] = 0 ; // Next one
894           }
895           else
896             return returnfalse( this , "depth5-0" , qName ) ;
897           break ;
898         case 1 :
899           if ( qName == "outParameter" ) {
900             if ( fieldvalue[depth] != NULLSTRING )
901               return returnfalse( this , "depth5-1" , qName ) ;
902             fieldvalue[depth] = NULLSTRING ;
903             int size = aNode.theService.ServiceoutParameter.length() ;
904             aNode.theService.ServiceoutParameter.length( size+1 ) ;
905             aNode.theService.ServiceoutParameter[size] = aParameter ;
906 // One more aParameter Output
907             step[6] = 2 ; // Next one
908           }
909           else
910             return returnfalse( this , "depth5-1" , qName ) ;
911           break ;
912         case 2 :
913           if ( qName == "x" ) {
914             if ( fieldvalue[depth] == NULLSTRING )
915               return returnfalse( this , "depth5-2" , qName ) ;
916             sscanf( fieldvalue[depth].c_str() , "%d" , &X ) ;
917             fieldvalue[depth] = NULLSTRING ;
918             step[depth]++ ;
919           }
920           else
921             return returnfalse( this , "depth5-2" , qName ) ;
922           break ;
923         case 3 :
924           if ( qName == "y" ) {
925             if ( fieldvalue[depth] == NULLSTRING )
926               return returnfalse( this , "depth5-3" , qName ) ;
927             sscanf( fieldvalue[depth].c_str() , "%d" , &Y ) ;
928             fieldvalue[depth] = NULLSTRING ;
929           }
930           else
931             return returnfalse( this , "depth5-3" , qName ) ;
932           break ;
933         case 4 :
934           if ( qName == "inParameter-type" ) {
935             if ( fieldvalue[depth] == NULLSTRING )
936               return returnfalse( this , "depth5-4" , qName ) ;
937             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parametertype ) ;
938             fieldvalue[depth] = NULLSTRING ;
939             step[depth]++ ;
940 #if TRACE
941   //cout << "InDataStreamParameter.inParameter-type " << anInDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]" << step[depth] << endl ;
942 #endif
943             break ;
944           }
945           else
946             step[depth] = 6 ;
947 //            return returnfalse( this , "depth5-4" , qName ) ;
948 //          break ;
949         case 5 :
950           if ( qName == "inParameter-name" ) {
951             if ( fieldvalue[depth] == NULLSTRING )
952               return returnfalse( this , "depth5-5" , qName ) ;
953             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
954               anInDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ;
955             }
956             else {
957               anInDataStreamParameter.theDataStreamParameter.Parametername = "" ;
958             }
959             fieldvalue[depth] = NULLSTRING ;
960 #if TRACE
961   //cout << "InDataStreamParameter.inParameter-name " << anInDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]" << step[depth] << endl ;
962 #endif
963 //            step[depth]++ ;
964 //            step[depth] = 4 ;
965             break ;
966           }
967           else if ( qName == "inParameter-dependency" ) {
968             if ( fieldvalue[depth] == NULLSTRING )
969               return returnfalse( this , "depth5-5" , qName ) ;
970             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parameterdependency ) ;
971             fieldvalue[depth] = NULLSTRING ;
972 #if TRACE
973   //cout << "InDataStreamParameter.inParameter-dependency " << anInDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]"
974                  << step[depth] << endl ;
975 #endif
976 //            step[depth]++ ;
977 //            step[depth] = 4 ;
978             break ;
979           }
980           else if ( qName == "inParameter-schema" ) {
981             if ( fieldvalue[depth] == NULLSTRING )
982               return returnfalse( this , "depth5-5" , qName ) ;
983             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfSchema ) ;
984             fieldvalue[depth] = NULLSTRING ;
985 #if TRACE
986   //cout << "InDataStreamParameter.inParameter-schema " << anInDataStreamParameter.theKindOfSchema << " step[" << depth << "]"
987                  << step[depth] << endl ;
988 #endif
989 //            step[depth]++ ;
990 //            step[depth] = 4 ;
991             break ;
992           }
993           else if ( qName == "inParameter-interpolation" ) {
994             if ( fieldvalue[depth] == NULLSTRING )
995               return returnfalse( this , "depth5-5" , qName ) ;
996             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfInterpolation ) ;
997             fieldvalue[depth] = NULLSTRING ;
998 #if TRACE
999   //cout << "InDataStreamParameter.inParameter-interpolation " << anInDataStreamParameter.theKindOfInterpolation << " step[" << depth << "]"
1000                  << step[depth] << endl ;
1001 #endif
1002 //            step[depth]++ ;
1003 //            step[depth] = 4 ;
1004             break ;
1005           }
1006           else if ( qName == "inParameter-extrapolation" ) {
1007             if ( fieldvalue[depth] == NULLSTRING )
1008               return returnfalse( this , "depth5-5" , qName ) ;
1009             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfExtrapolation ) ;
1010             fieldvalue[depth] = NULLSTRING ;
1011 //            step[depth]++ ;
1012             step[depth] = 4 ;
1013 #if TRACE
1014   //cout << "InDataStreamParameter.inParameter-extrapolation " << anInDataStreamParameter.theKindOfExtrapolation << " step[" << depth << "]"
1015                  << step[depth] << endl ;
1016 #endif
1017             break ;
1018           }
1019 //          else
1020 //            return returnfalse( this , "depth5-5" , qName ) ;
1021 //          break ;
1022         case 6 :
1023           if ( qName == "outParameter-type" ) {
1024             if ( fieldvalue[depth] == NULLSTRING )
1025               return returnfalse( this , "depth5-6" , qName ) ;
1026             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parametertype ) ;
1027             fieldvalue[depth] = NULLSTRING ;
1028 //            step[depth]++ ;
1029             step[depth] = 7 ;
1030 #if TRACE
1031   //cout << "OutDataStreamParameter.outParameter-type " << anOutDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]"
1032                  << step[depth] << endl ;
1033 #endif
1034           }
1035           else
1036             return returnfalse( this , "depth5-6" , qName ) ;
1037           break ;
1038         case 7 : 
1039           if ( qName == "outParameter-name" ) {
1040             if ( fieldvalue[depth] == NULLSTRING )
1041               return returnfalse( this , "depth5-7" , qName ) ;
1042             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
1043               anOutDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ;
1044             }
1045             else {
1046               anOutDataStreamParameter.theDataStreamParameter.Parametername = "" ;
1047             }
1048             fieldvalue[depth] = NULLSTRING ;
1049 #if TRACE
1050   //cout << "OutDataStreamParameter.outParameter-name " << anOutDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]"
1051                  << step[depth] << endl ;
1052 #endif
1053 //            step[depth]++ ;
1054 //            step[depth] = 6 ;
1055           }
1056           else if ( qName == "outParameter-dependency" ) {
1057             if ( fieldvalue[depth] == NULLSTRING )
1058               return returnfalse( this , "depth5-7" , qName ) ;
1059             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parameterdependency ) ;
1060             fieldvalue[depth] = NULLSTRING ;
1061 #if TRACE
1062   //cout << "OutDataStreamParameter.outParameter-dependency " << anOutDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]"
1063                  << step[depth] << endl ;
1064 #endif
1065 //            step[depth]++ ;
1066 //            step[depth] = 6 ;
1067           }
1068           else if ( qName == "outParameter-values" ) {
1069             if ( fieldvalue[depth] == NULLSTRING )
1070               return returnfalse( this , "depth5-7" , qName ) ;
1071             sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theNumberOfValues ) ;
1072             fieldvalue[depth] = NULLSTRING ;
1073 //            step[depth]++ ;
1074             step[depth] = 6 ;
1075 #if TRACE
1076   //cout << "OutDataStreamParameter.outParameter-values " << anOutDataStreamParameter.theNumberOfValues << " step[" << depth << "]"
1077                  << step[depth] << endl ;
1078 #endif
1079           }
1080           else
1081             return returnfalse( this , "depth5-7" , qName ) ;
1082           break ;
1083         case 8 :
1084           if ( qName == "FuncName" ) {
1085             if ( fieldvalue[depth] == NULLSTRING )
1086               return returnfalse( this , "depth5-8" , qName ) ;
1087             int l = aNode.theListOfFuncName.size() ;
1088             aNode.theListOfFuncName.resize( l+1 ) ;
1089             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
1090               aNode.theListOfFuncName[ l ] = fieldvalue[depth].c_str() ;
1091             }
1092             else {
1093               aNode.theListOfFuncName[ l ] = "" ;
1094             }
1095             aNode.theListOfPythonFunctions.resize( l+1 ) ;
1096             aNode.theListOfPythonFunctions[ l ] = new SUPERV::ListOfStrings() ;
1097 #if TRACE
1098             MESSAGE( " ==========theListOfFuncName/theListOfPythonFunctions size "
1099                      << l+1 )
1100 #endif
1101             fieldvalue[depth] = NULLSTRING ;
1102             step[depth]++ ;
1103           }
1104           else
1105             return returnfalse( this , "depth5-8" , qName ) ;
1106           break ;
1107         case 9 :
1108           if ( qName == "PyFunc" ) {
1109             if ( fieldvalue[depth] == NULLSTRING )
1110               return returnfalse( this , "depth5-9" , qName ) ;
1111             int l = aNode.theListOfPythonFunctions.size() - 1 ;
1112             SUPERV::ListOfStrings aPythonFunction = *aNode.theListOfPythonFunctions[ l ] ;
1113             int ll = aPythonFunction.length() ;
1114             aPythonFunction.length( ll+1 ) ;
1115             if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) {
1116               aPythonFunction[ ll ] = fieldvalue[depth].c_str() ;
1117             }
1118             else {
1119               aPythonFunction[ ll ] = NULLSTRING ;
1120             }
1121             if ( ll ) {
1122               aNode.theListOfPythonFunctions.resize( l ) ;
1123               aNode.theListOfPythonFunctions.resize( l+1 ) ;
1124             }
1125             aNode.theListOfPythonFunctions[ l ] = new SUPERV::ListOfStrings( aPythonFunction ) ;
1126 #if TRACE
1127             MESSAGE( " ==========theListOfPythonFunctions[" << l << "] size " << ll+1
1128                      << " [" << ll << "] = " << aPythonFunction[ ll ] )
1129 #endif
1130             fieldvalue[depth] = NULLSTRING ;
1131 //            step[depth]++ ;
1132           }
1133           else
1134             return returnfalse( this , "depth5-9" , qName ) ;
1135           break ;
1136         default:
1137           return returnfalse( this , "depth5-d" , qName ) ;
1138           break ;
1139         }
1140       break ;
1141     }
1142
1143     case 6 : {
1144       switch ( step[depth] ) {
1145         case 0 :
1146           if ( qName == "inParameter-type" ) {
1147             if ( fieldvalue[depth] == NULLSTRING )
1148               return returnfalse( this , "depth6-0" , qName ) ;
1149             aParameter.Parametertype = fieldvalue[depth].c_str() ;
1150             fieldvalue[depth] = NULLSTRING ;
1151             step[depth]++ ;
1152           }
1153           else
1154             return returnfalse( this , "depth6-0" , qName ) ;
1155           break ;
1156         case 1 :
1157           if ( qName == "inParameter-name" ) {
1158             if ( fieldvalue[depth] == NULLSTRING )
1159               return returnfalse( this , "depth6-1" , qName ) ;
1160             aParameter.Parametername = fieldvalue[depth].c_str() ;
1161             fieldvalue[depth] = NULLSTRING ;
1162             step[depth]++ ;
1163           }
1164           else
1165             return returnfalse( this , "depth6-1" , qName ) ;
1166           break ;
1167         case 2 :
1168           if ( qName == "outParameter-type" ) {
1169             if ( fieldvalue[depth] == NULLSTRING )
1170               return returnfalse( this , "depth6-2" , qName ) ;
1171             aParameter.Parametertype = fieldvalue[depth].c_str() ;
1172             fieldvalue[depth] = NULLSTRING ;
1173             step[depth]++ ;
1174           }
1175           else
1176             return returnfalse( this , "depth6-2" , qName ) ;
1177           break ;
1178         case 3 :
1179           if ( qName == "outParameter-name" ) {
1180             if ( fieldvalue[depth] == NULLSTRING )
1181               return returnfalse( this , "depth6-3" , qName ) ;
1182             aParameter.Parametername = fieldvalue[depth].c_str() ;
1183             fieldvalue[depth] = NULLSTRING ;
1184             step[depth]++ ;
1185           }
1186           else
1187             return returnfalse( this , "depth6-3" , qName ) ;
1188           break ;
1189         default:
1190           return returnfalse( this , "depth6-d" , qName ) ;
1191           break ;
1192         }
1193       break ;
1194     }
1195   }
1196
1197 #if TRACE
1198   //cout << "return from endElement " << qName << " step[" << depth << "]" << step[depth] << endl ;
1199 #endif
1200   return TRUE;
1201 }
1202
1203
1204 bool GraphBase::XmlHandler::characters( const QString& ch ) {
1205   // we are not interested in whitespaces
1206   QString ch_simplified = ch.simplifyWhiteSpace();
1207   if ( ch_simplified.isEmpty() ) {
1208     return TRUE;
1209   }
1210   depth -= 1 ;
1211 #if TRACE
1212   MESSAGE( "characters step[" << depth << "]=" << step[depth]
1213        << " ch " << ch << " fieldvalue_must_be_NULL : '" << fieldvalue[depth] << "'" ) ;
1214 #endif
1215   if ( depth < 0 || fieldvalue[depth] != NULLSTRING )
1216     return returnfalse( this , "characters " , ch ) ;
1217
1218 //  fieldvalue[depth] = (const char * ) ch ;
1219   fieldvalue[depth] = ch.latin1() ;
1220   return TRUE;
1221 }
1222
1223
1224 QString GraphBase::XmlHandler::errorString() {
1225   //cout << "the document is not in the quote file format" << endl ;
1226   return "the document is not in the quote file format";
1227 }
1228
1229
1230 bool GraphBase::XmlHandler::fatalError( const QXmlParseException& exception ) {
1231   errorProt += QString( "fatal parsing error: %1 in line %2, column %3\n" )
1232     .arg( exception.message() )
1233     .arg( exception.lineNumber() )
1234     .arg( exception.columnNumber() );
1235   //cout << "GraphBase::XmlHandler::fatalError " << errorProt.latin1() << endl ;
1236   return QXmlDefaultHandler::fatalError( exception );
1237 }
1238
1239 #if 0
1240 SALOME_SuperVision::Date GraphBase::XmlHandler::StringToDate( QString& myStrDate) const
1241 {
1242   SALOME_SuperVision::Date aDate;
1243   QString qstrDate(myStrDate);
1244   QString qstrTemp;
1245
1246   // Date
1247   int iPos = qstrDate.find("/");
1248   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1249   aDate.Day = qstrTemp.toShort();
1250   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1251   iPos = qstrDate.find("/");
1252   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1253   aDate.Month = qstrTemp.toShort();
1254   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1255   iPos = qstrDate.find(" ");
1256   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1257   aDate.Year = qstrTemp.toShort();
1258
1259   // Time
1260   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1261   iPos = qstrDate.find(":");
1262   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1263   aDate.Hour = qstrTemp.toShort();
1264   qstrDate = qstrDate.right(qstrDate.length()-iPos);
1265   iPos = qstrDate.find(":");
1266   qstrTemp = qstrDate.left(iPos).stripWhiteSpace();
1267   aDate.Minute = qstrTemp.toShort();
1268   qstrDate = qstrDate.right(qstrDate.length()-iPos).stripWhiteSpace();
1269   aDate.Second = qstrDate.toShort();
1270
1271   return aDate;
1272 }
1273 #endif
1274
1275