xml/libxml2libs/test/xmlengtester/xmlengtester_emulator/src/xmlengtesterblocksdeserializedom.cpp
changeset 0 e35f40988205
child 20 889504eac4fb
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "TestContentHandler.h"
       
    19 #include "xmlengtester.h"
       
    20 
       
    21 #include <e32svr.h>
       
    22 #include <e32std.h>
       
    23 #include <domain/osextensions/StifParser.h>
       
    24 #include <domain/osextensions/Stiftestinterface.h>
       
    25 
       
    26 #include <XmlEngDeserializer.h>
       
    27 #include <XmlEngDeserializerDOM.h>
       
    28 #include "xmlengtesterdef.h"
       
    29 
       
    30 #include <InetProtTextUtils.h>
       
    31 #include <libc\string.h>
       
    32 #include <charconv.h>
       
    33 #include <UTF.H>
       
    34 
       
    35 #include "XmlEngBinaryContainer.h"
       
    36 #include "XmlEngChunkContainer.h"
       
    37 #include "XmlEngFileContainer.h"
       
    38 #include "XmlEngDataContainer.h"
       
    39 
       
    40 TInt CLibxml2Tester::DOMDeserializeL( CStifItemParser& aItem)
       
    41     {
       
    42     TInt err;
       
    43     TPtrC pDeserializerType;
       
    44     aItem.GetNextString( pDeserializerType );
       
    45 	
       
    46     TPtrC pInputFile;
       
    47     aItem.GetNextString( pInputFile );
       
    48 	
       
    49     TPtrC pBinary;
       
    50    TPtrC pFile;
       
    51    if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
    52         {
       
    53         aItem.GetNextString( pBinary );
       
    54         aItem.GetNextString(pFile);	
       
    55         }
       
    56 	
       
    57     TPtrC pOutputFile;
       
    58     aItem.GetNextString( pOutputFile );
       
    59     
       
    60     TPtrC pDirtyReturn;
       
    61     aItem.GetNextString( pDirtyReturn );
       
    62     
       
    63     TLex inputNum (pDirtyReturn);
       
    64     TInt dirtyReturn;
       
    65      inputNum.Val(dirtyReturn);	
       
    66         
       
    67 //    TInt nContainers = 3;
       
    68     RFile fileHandle;
       
    69     RFs aRFs;
       
    70     aRFs.Connect();
       
    71     CleanupClosePushL( aRFs );
       
    72     RArray<TXmlEngDataContainer> list;
       
    73     if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
    74         {
       
    75         SetupDocumentL();	  
       
    76         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
    77         CleanupStack::PushL(binbuf);
       
    78         TBufC<100> chunkName(_L("ChunkContainer") );
       
    79         TInt size = 2000;
       
    80         TInt maxSize = 10000;
       
    81         TInt offset = 0;
       
    82         TInt binarySize = CID_2().Length();
       
    83 //        TBool isReadOnly = EFalse;
       
    84         RChunk chunk;
       
    85         chunk.CreateGlobal(chunkName, size, maxSize);
       
    86         CleanupClosePushL(chunk);	
       
    87 	RFile fp;
       
    88 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
    89 	CleanupClosePushL(fp); 	
       
    90         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
    91         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
    92         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
    93         iDoc.DocumentElement().AppendChildL(bincont);   
       
    94         iDoc.DocumentElement().AppendChildL(chunkcont);
       
    95         iDoc.DocumentElement().AppendChildL(filecont);
       
    96         CleanupClosePushL(list);	////
       
    97         iDoc.GetDataContainerList(list); 
       
    98         }	
       
    99 	
       
   100     RXmlEngDocument doc;
       
   101     	
       
   102     if( pDeserializerType.FindF( DEFAULT ) != KErrNotFound )
       
   103         {
       
   104         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   105         CleanupStack::PushL( des );
       
   106         des->UseDOMImplementationL( DOM_impl);
       
   107         des->SetInputFileL( pInputFile );
       
   108         TRAP(err,doc=des->DeserializeL());
       
   109         
       
   110         }
       
   111     else if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   112         {
       
   113         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   114         CleanupStack::PushL( des );
       
   115         des->UseDOMImplementationL( DOM_impl);
       
   116         des->SetInputFileL( pInputFile,EDeserializerXOP);
       
   117         TRAP(err,doc=des->DeserializeL());
       
   118         
       
   119         }
       
   120     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   121         {
       
   122         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   123         CleanupStack::PushL( des );
       
   124         des->UseDOMImplementationL( DOM_impl);
       
   125         des->UseExternalDataL( list );
       
   126         des->SetInputFileL( pInputFile,EDeserializerXOPInfoset );
       
   127         TRAP(err,doc=des->DeserializeL());
       
   128         }    
       
   129     else if( pDeserializerType.FindF( GZIP ) != KErrNotFound )     
       
   130         {
       
   131         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   132         CleanupStack::PushL( des );
       
   133         des->UseDOMImplementationL( DOM_impl);
       
   134         des->SetInputFileL( pInputFile,EDeserializerGZip);
       
   135         TRAP(err,doc=des->DeserializeL());
       
   136         }
       
   137       
       
   138     	SaveDocumentL(doc,pOutputFile);
       
   139         
       
   140     if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   141         {   
       
   142         CleanupStack::PopAndDestroy( 6 );
       
   143         }
       
   144     else
       
   145         {
       
   146         CleanupStack::PopAndDestroy( 2 );      
       
   147         }
       
   148     if ( err == dirtyReturn ) return KErrNone;		
       
   149     else return err;
       
   150     }
       
   151     
       
   152 TInt CLibxml2Tester::DOMDeserialize2L( CStifItemParser& aItem)
       
   153     {
       
   154     TInt err;
       
   155     TPtrC pDeserializerType;
       
   156     aItem.GetNextString( pDeserializerType );
       
   157 	
       
   158     TPtrC pInputFile;
       
   159     aItem.GetNextString( pInputFile );
       
   160    TPtrC pBinary;
       
   161    TPtrC pFile;
       
   162    if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   163         {
       
   164         aItem.GetNextString( pBinary );
       
   165         aItem.GetNextString(pFile);	
       
   166         }
       
   167     TPtrC pOutputFile;
       
   168     aItem.GetNextString( pOutputFile );
       
   169 
       
   170     TPtrC pDirtyReturn;
       
   171     aItem.GetNextString( pDirtyReturn );
       
   172     
       
   173     TLex inputNum (pDirtyReturn);
       
   174     TInt dirtyReturn;
       
   175      inputNum.Val(dirtyReturn);
       
   176      	
       
   177 //    TInt nContainers = 3;
       
   178     RFile fileHandle;
       
   179     RFs aRFs;
       
   180     aRFs.Connect();
       
   181     CleanupClosePushL( aRFs );
       
   182     RArray<TXmlEngDataContainer> list;
       
   183     if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   184         {
       
   185         SetupDocumentL();	  
       
   186         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   187         CleanupStack::PushL(binbuf);
       
   188         TBufC<100> chunkName(_L("ChunkContainer") );
       
   189         TInt size = 2000;
       
   190         TInt maxSize = 10000;
       
   191         TInt offset = 0;
       
   192         TInt binarySize = CID_2().Length();
       
   193 //        TBool isReadOnly = EFalse;
       
   194         RChunk chunk;
       
   195         chunk.CreateGlobal(chunkName, size, maxSize);
       
   196         CleanupClosePushL(chunk);	
       
   197 	RFile fp;
       
   198 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   199 	CleanupClosePushL(fp); 	
       
   200         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   201         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   202         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   203         iDoc.DocumentElement().AppendChildL(bincont);   
       
   204         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   205         iDoc.DocumentElement().AppendChildL(filecont);
       
   206         CleanupClosePushL(list);	////
       
   207         iDoc.GetDataContainerList(list); 
       
   208         }	
       
   209 	
       
   210      HBufC8* buf = ReadFileL(pInputFile);
       
   211     CleanupStack::PushL(buf);
       
   212     RXmlEngDocument doc;
       
   213     if( pDeserializerType.FindF( DEFAULT ) != KErrNotFound )
       
   214         {
       
   215         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   216         CleanupStack::PushL( des );
       
   217         des->UseDOMImplementationL( DOM_impl);
       
   218         des->SetInputBuffer(buf->Des());
       
   219         TRAP(err,doc=des->DeserializeL());
       
   220         }
       
   221     else if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   222         {
       
   223         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL( );
       
   224         CleanupStack::PushL( des );
       
   225         des->UseDOMImplementationL( DOM_impl);
       
   226         des->SetInputBuffer(buf->Des(),EDeserializerXOP);
       
   227         TRAP(err,doc=des->DeserializeL());
       
   228         }
       
   229     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   230         {
       
   231         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   232         CleanupStack::PushL( des );
       
   233         des->UseDOMImplementationL( DOM_impl);
       
   234          des->UseExternalDataL( list );
       
   235         des->SetInputBuffer(buf->Des(),EDeserializerXOPInfoset);
       
   236         TRAP(err,doc=des->DeserializeL());
       
   237         }
       
   238     else if( pDeserializerType.FindF( GZIP ) != KErrNotFound )     
       
   239         {
       
   240         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   241         CleanupStack::PushL( des );
       
   242         des->UseDOMImplementationL( DOM_impl);
       
   243          
       
   244         des->SetInputBuffer(buf->Des(),EDeserializerGZip);
       
   245         TRAP(err,doc=des->DeserializeL());
       
   246         
       
   247         
       
   248         }
       
   249 
       
   250     	SaveDocumentL(doc,pOutputFile);
       
   251     	
       
   252      if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   253         {   
       
   254         CleanupStack::PopAndDestroy( 7 );
       
   255         }
       
   256     else
       
   257         {
       
   258         CleanupStack::PopAndDestroy( 3 );      
       
   259         }
       
   260     		
       
   261     if ( err == dirtyReturn ) return KErrNone;		
       
   262     else return err;
       
   263     }    
       
   264 
       
   265 TInt CLibxml2Tester::DOMDeserializeFromFileL( CStifItemParser& aItem)
       
   266     {
       
   267     TInt err;
       
   268     TPtrC pDeserializerType;
       
   269     aItem.GetNextString( pDeserializerType );
       
   270 	
       
   271     TPtrC pInputFile;
       
   272     aItem.GetNextString( pInputFile );
       
   273     
       
   274    TPtrC pBinary;
       
   275    TPtrC pFile;
       
   276    if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   277         {
       
   278         aItem.GetNextString( pBinary );
       
   279         aItem.GetNextString(pFile);	
       
   280         }
       
   281 	
       
   282     TPtrC pOutputFile;
       
   283     aItem.GetNextString( pOutputFile );
       
   284 
       
   285     TPtrC pDirtyReturn;
       
   286     aItem.GetNextString( pDirtyReturn );
       
   287     
       
   288     TLex inputNum (pDirtyReturn);
       
   289     TInt dirtyReturn;
       
   290      inputNum.Val(dirtyReturn);
       
   291      	
       
   292 //       TInt nContainers = 3;
       
   293     RFile fileHandle;
       
   294     RFs aRFs;
       
   295     aRFs.Connect();
       
   296     CleanupClosePushL( aRFs );
       
   297 	
       
   298     RArray<TXmlEngDataContainer> list;
       
   299     if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   300         {
       
   301         SetupDocumentL();	  
       
   302         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   303         CleanupStack::PushL(binbuf);
       
   304         TBufC<100> chunkName(_L("ChunkContainer") );
       
   305         TInt size = 2000;
       
   306         TInt maxSize = 10000;
       
   307         TInt offset = 0;
       
   308         TInt binarySize = CID_2().Length();
       
   309 //        TBool isReadOnly = EFalse;
       
   310         RChunk chunk;
       
   311         chunk.CreateGlobal(chunkName, size, maxSize);
       
   312         CleanupClosePushL(chunk);	
       
   313 	RFile fp;
       
   314 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   315 	CleanupClosePushL(fp); 	
       
   316         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   317         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   318         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   319         iDoc.DocumentElement().AppendChildL(bincont);   
       
   320         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   321         iDoc.DocumentElement().AppendChildL(filecont);
       
   322         CleanupClosePushL(list);	////
       
   323         iDoc.GetDataContainerList(list); 
       
   324         }	
       
   325 
       
   326     RXmlEngDocument doc;
       
   327     
       
   328     if( pDeserializerType.FindF( DEFAULT ) != KErrNotFound )
       
   329         {
       
   330         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   331         CleanupStack::PushL( des );
       
   332         des->UseDOMImplementationL( DOM_impl);
       
   333         TRAP(err,doc=des->DeserializeL( pInputFile ));
       
   334         }
       
   335     else if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   336         {
       
   337         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL( );
       
   338         CleanupStack::PushL( des );
       
   339         des->UseDOMImplementationL( DOM_impl);
       
   340         TRAP(err,doc=des->DeserializeL( pInputFile,EDeserializerXOP ));
       
   341         }
       
   342     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   343         {
       
   344         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   345         CleanupStack::PushL( des );
       
   346      des->UseExternalDataL( list );
       
   347         des->UseDOMImplementationL( DOM_impl);
       
   348         TRAP(err,doc=des->DeserializeL( pInputFile,EDeserializerXOPInfoset ));
       
   349         }
       
   350     else if( pDeserializerType.FindF( GZIP ) != KErrNotFound )     
       
   351         {
       
   352         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   353         CleanupStack::PushL( des );
       
   354         des->UseDOMImplementationL( DOM_impl);				
       
   355         TRAP(err,doc=des->DeserializeL(pInputFile , EDeserializerGZip));			
       
   356         }
       
   357     		SaveDocumentL(doc,pOutputFile);
       
   358          if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   359         {   
       
   360         CleanupStack::PopAndDestroy( 6 );
       
   361         }
       
   362     else
       
   363         {
       
   364         CleanupStack::PopAndDestroy( 2 );      
       
   365         }		
       
   366     if ( err == dirtyReturn ) return KErrNone;		
       
   367     else return err;
       
   368     }
       
   369     
       
   370 TInt CLibxml2Tester::DOMDeserializeFromFile2L( CStifItemParser& aItem)
       
   371     {
       
   372     TInt err;
       
   373     TPtrC pDeserializerType;
       
   374     aItem.GetNextString( pDeserializerType );
       
   375 	
       
   376     TPtrC pInputFile;
       
   377     aItem.GetNextString( pInputFile );
       
   378     
       
   379       TPtrC pBinary;
       
   380    TPtrC pFile;
       
   381    if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   382         {
       
   383         aItem.GetNextString( pBinary );
       
   384         aItem.GetNextString(pFile);	
       
   385         }
       
   386 	
       
   387     TPtrC pOutputFile;
       
   388     aItem.GetNextString( pOutputFile );
       
   389 
       
   390     TPtrC pDirtyReturn;
       
   391     aItem.GetNextString( pDirtyReturn );
       
   392     
       
   393     TLex inputNum (pDirtyReturn);
       
   394     TInt dirtyReturn;
       
   395      inputNum.Val(dirtyReturn);
       
   396      	
       
   397 //       TInt nContainers = 3;
       
   398     RFile fileHandle;
       
   399     RFs aRFs;
       
   400     aRFs.Connect();
       
   401     CleanupClosePushL( aRFs );
       
   402     RArray<TXmlEngDataContainer> list;
       
   403     if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   404         {
       
   405         SetupDocumentL();	  
       
   406         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   407         CleanupStack::PushL(binbuf);
       
   408         TBufC<100> chunkName(_L("ChunkContainer") );
       
   409         TInt size = 2000;
       
   410         TInt maxSize = 10000;
       
   411         TInt offset = 0;
       
   412         TInt binarySize = CID_2().Length();
       
   413 //        TBool isReadOnly = EFalse;
       
   414         RChunk chunk;
       
   415         chunk.CreateGlobal(chunkName, size, maxSize);
       
   416         CleanupClosePushL(chunk);	
       
   417 	RFile fp;
       
   418 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   419 	CleanupClosePushL(fp); 	
       
   420         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   421         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   422         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   423         iDoc.DocumentElement().AppendChildL(bincont);   
       
   424         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   425         iDoc.DocumentElement().AppendChildL(filecont);
       
   426         CleanupClosePushL(list);	////
       
   427         iDoc.GetDataContainerList(list); 
       
   428         }	
       
   429 	
       
   430     RXmlEngDocument doc;
       
   431     
       
   432     if( pDeserializerType.FindF( DEFAULT ) != KErrNotFound )
       
   433         {
       
   434         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   435         CleanupStack::PushL( des );
       
   436         des->UseDOMImplementationL( DOM_impl);
       
   437         TRAP(err,doc=des->DeserializeL( aRFs,pInputFile ));
       
   438         }
       
   439     else if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   440         {
       
   441         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL( );
       
   442         CleanupStack::PushL( des );
       
   443         des->UseDOMImplementationL( DOM_impl);
       
   444         TRAP(err,doc=des->DeserializeL( aRFs,pInputFile,EDeserializerXOP ));
       
   445         }
       
   446     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   447         {
       
   448         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   449         CleanupStack::PushL( des );
       
   450          des->UseExternalDataL( list );
       
   451         des->UseDOMImplementationL( DOM_impl);
       
   452         TRAP(err,doc=des->DeserializeL( aRFs,pInputFile,EDeserializerXOPInfoset ));
       
   453         }
       
   454     else if( pDeserializerType.FindF( GZIP ) != KErrNotFound )     
       
   455         {
       
   456         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   457         CleanupStack::PushL( des );
       
   458         des->UseDOMImplementationL( DOM_impl);				
       
   459         TRAP(err,doc=des->DeserializeL(aRFs,pInputFile , EDeserializerGZip));			
       
   460         }
       
   461   	SaveDocumentL(doc,pOutputFile);  	
       
   462          if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   463         {   
       
   464         CleanupStack::PopAndDestroy( 6 );
       
   465         }
       
   466     else
       
   467         {
       
   468         CleanupStack::PopAndDestroy( 2 );      
       
   469         }		
       
   470     if ( err == dirtyReturn ) return KErrNone;		
       
   471     else return err;
       
   472     }    
       
   473 
       
   474 TInt CLibxml2Tester::DOMDeserializeFromBufferL(CStifItemParser& aItem)
       
   475     {    
       
   476     TInt err;    
       
   477     TPtrC pDeserializerType;
       
   478     aItem.GetNextString( pDeserializerType );
       
   479 	
       
   480     TPtrC pInputFile;
       
   481     aItem.GetNextString( pInputFile );
       
   482     
       
   483    TPtrC pBinary;
       
   484    TPtrC pFile;
       
   485    if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   486         {
       
   487         aItem.GetNextString( pBinary );
       
   488         aItem.GetNextString(pFile);	
       
   489         }
       
   490 	
       
   491     TPtrC pOutputFile;
       
   492     aItem.GetNextString( pOutputFile );
       
   493     
       
   494     TPtrC pDirtyReturn;
       
   495     aItem.GetNextString( pDirtyReturn );
       
   496     
       
   497     TLex lexer (pDirtyReturn);
       
   498     TInt dirtyReturn;
       
   499      lexer.Val(dirtyReturn);
       
   500     
       
   501     HBufC8* buf = ReadFileL(pInputFile);
       
   502     CleanupStack::PushL(buf);
       
   503 		
       
   504 //       TInt nContainers = 3;
       
   505     RFile fileHandle;
       
   506     RFs aRFs;
       
   507     aRFs.Connect();
       
   508     CleanupClosePushL( aRFs );
       
   509 	
       
   510     RArray<TXmlEngDataContainer> list;
       
   511     if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   512         {
       
   513         SetupDocumentL();	  
       
   514         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   515         CleanupStack::PushL(binbuf);
       
   516         TBufC<100> chunkName(_L("ChunkContainer") );
       
   517         TInt size = 2000;
       
   518         TInt maxSize = 10000;
       
   519         TInt offset = 0;
       
   520         TInt binarySize = CID_2().Length();
       
   521 //        TBool isReadOnly = EFalse;
       
   522         RChunk chunk;
       
   523         chunk.CreateGlobal(chunkName, size, maxSize);
       
   524         CleanupClosePushL(chunk);	
       
   525 	RFile fp;
       
   526 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   527 	CleanupClosePushL(fp); 	
       
   528         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   529         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   530         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   531         iDoc.DocumentElement().AppendChildL(bincont);   
       
   532         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   533         iDoc.DocumentElement().AppendChildL(filecont);
       
   534         CleanupClosePushL(list);	////
       
   535         iDoc.GetDataContainerList(list); 
       
   536         }	
       
   537 	
       
   538 
       
   539     RXmlEngDocument doc;
       
   540 		
       
   541     if( pDeserializerType.FindF( DEFAULT ) != KErrNotFound )
       
   542         {
       
   543         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   544         CleanupStack::PushL( des );
       
   545         des->UseDOMImplementationL( DOM_impl);
       
   546         TRAP(err,doc=des->DeserializeL(buf->Des()));
       
   547         }
       
   548     else if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   549         {
       
   550         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   551         CleanupStack::PushL( des );
       
   552         des->UseDOMImplementationL( DOM_impl);
       
   553         TRAP(err,doc=des->DeserializeL(buf->Des(),EDeserializerXOP));
       
   554         }
       
   555     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   556         {
       
   557         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   558         CleanupStack::PushL( des );
       
   559         des->UseExternalDataL( list );
       
   560         des->UseDOMImplementationL( DOM_impl);
       
   561         TRAP(err,doc=des->DeserializeL(buf->Des(), EDeserializerXOPInfoset ));
       
   562         }
       
   563     else if( pDeserializerType.FindF( GZIP ) != KErrNotFound )     
       
   564         {
       
   565         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   566         CleanupStack::PushL( des );
       
   567         des->UseDOMImplementationL( DOM_impl);
       
   568         TRAP(err,doc=des->DeserializeL(buf->Des(),EDeserializerGZip));
       
   569         }
       
   570 	SaveDocumentL(doc,pOutputFile);
       
   571          if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )   
       
   572         {   
       
   573         CleanupStack::PopAndDestroy( 7 );
       
   574         }
       
   575     else
       
   576         {
       
   577         CleanupStack::PopAndDestroy( 3 );      
       
   578         }
       
   579     
       
   580     if ( err == dirtyReturn ) return KErrNone;		
       
   581     else return err;	
       
   582     }
       
   583 
       
   584 TInt CLibxml2Tester::TestDOMDeserializerL(CStifItemParser& aItem)
       
   585 	{
       
   586 	// multiple deserialization in one row
       
   587 	TPtrC pType;
       
   588 	aItem.GetNextString(pType);
       
   589 	
       
   590 	TPtrC pDoc;
       
   591 	aItem.GetNextString(pDoc);
       
   592 	        TPtrC pBinary;
       
   593         TPtrC pFile;
       
   594         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   595             {
       
   596         aItem.GetNextString( pBinary );
       
   597         aItem.GetNextString(pFile);	
       
   598             }
       
   599 	TPtrC pOut;
       
   600 	aItem.GetNextString(pOut);
       
   601 	
       
   602 	
       
   603 //  TInt nContainers = 3;
       
   604         RFile fileHandle;
       
   605         RFs aRFs;
       
   606         aRFs.Connect();
       
   607         CleanupClosePushL( aRFs );
       
   608 	
       
   609         RArray<TXmlEngDataContainer> list;
       
   610         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   611         {
       
   612         SetupDocumentL();	  
       
   613         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   614         CleanupStack::PushL(binbuf);
       
   615         TBufC<100> chunkName(_L("ChunkContainer") );
       
   616         TInt size = 2000;
       
   617         TInt maxSize = 10000;
       
   618         TInt offset = 0;
       
   619         TInt binarySize = CID_2().Length();
       
   620 //        TBool isReadOnly = EFalse;
       
   621         RChunk chunk;
       
   622         chunk.CreateGlobal(chunkName, size, maxSize);
       
   623         CleanupClosePushL(chunk);	
       
   624 	RFile fp;
       
   625 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   626 	CleanupClosePushL(fp); 	
       
   627         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   628         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   629         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   630         iDoc.DocumentElement().AppendChildL(bincont);   
       
   631         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   632         iDoc.DocumentElement().AppendChildL(filecont);
       
   633         CleanupClosePushL(list);	////
       
   634         iDoc.GetDataContainerList(list); 
       
   635         }	
       
   636 	
       
   637 
       
   638         RXmlEngDocument doc;
       
   639 	
       
   640     CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   641     CleanupStack::PushL( des );
       
   642     des->UseDOMImplementationL( DOM_impl);
       
   643     for (TInt i = 0; i < 20; i++ )
       
   644     	{
       
   645     	des->SetInputFileL(pDoc, RetDeserializerType(pType));
       
   646     	    if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   647             {
       
   648             des->UseExternalDataL( list );
       
   649             }
       
   650     	doc=des->DeserializeL();
       
   651     	doc=des->DeserializeL();
       
   652     	}
       
   653     	
       
   654     	SaveDocumentL(doc,pOut);
       
   655     	
       
   656 	   if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   657             {
       
   658             CleanupStack::PopAndDestroy( 6 );
       
   659             }
       
   660             else
       
   661             {
       
   662             CleanupStack::PopAndDestroy( 2 );    
       
   663             }
       
   664 	return KErrNone;	
       
   665 	}
       
   666 		
       
   667 
       
   668 TInt CLibxml2Tester::TestDOMSetInputFileL(CStifItemParser& aItem)
       
   669         {
       
   670         TPtrC pType;
       
   671         aItem.GetNextString(pType);
       
   672 	
       
   673         TPtrC pDoc;
       
   674         aItem.GetNextString(pDoc);
       
   675         
       
   676         TPtrC pBinary;
       
   677         TPtrC pFile;
       
   678         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   679             {
       
   680         aItem.GetNextString( pBinary );
       
   681         aItem.GetNextString(pFile);	
       
   682             }
       
   683 	
       
   684         TPtrC pOut;
       
   685         aItem.GetNextString(pOut);
       
   686 		
       
   687 //        TInt nContainers = 3;
       
   688         RFile fileHandle;
       
   689         RFs aRFs;
       
   690         aRFs.Connect();
       
   691         CleanupClosePushL( aRFs );
       
   692 	
       
   693         RArray<TXmlEngDataContainer> list;
       
   694         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   695         {
       
   696         SetupDocumentL();	  
       
   697         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   698         CleanupStack::PushL(binbuf);
       
   699         TBufC<100> chunkName(_L("ChunkContainer") );
       
   700         TInt size = 2000;
       
   701         TInt maxSize = 10000;
       
   702         TInt offset = 0;
       
   703         TInt binarySize = CID_2().Length();
       
   704 //        TBool isReadOnly = EFalse;
       
   705         RChunk chunk;
       
   706         chunk.CreateGlobal(chunkName, size, maxSize);
       
   707         CleanupClosePushL(chunk);	
       
   708 	RFile fp;
       
   709 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   710 	CleanupClosePushL(fp); 	
       
   711         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   712         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   713         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   714         iDoc.DocumentElement().AppendChildL(bincont);   
       
   715         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   716         iDoc.DocumentElement().AppendChildL(filecont);
       
   717         CleanupClosePushL(list);	////
       
   718         iDoc.GetDataContainerList(list); 
       
   719         }	
       
   720 	
       
   721 
       
   722         RXmlEngDocument doc;
       
   723         
       
   724        
       
   725         CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   726         CleanupStack::PushL( des );
       
   727         des->UseDOMImplementationL( DOM_impl);
       
   728         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   729             {
       
   730             des->UseExternalDataL( list );
       
   731             }
       
   732         des->SetInputFileL(pDoc, RetDeserializerType(pType) );
       
   733         doc=des->DeserializeL();
       
   734         SaveDocumentL(doc,pOut);
       
   735        
       
   736         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   737             {
       
   738             CleanupStack::PopAndDestroy( 6 );
       
   739             }
       
   740             else
       
   741             {
       
   742             CleanupStack::PopAndDestroy( 2 );    
       
   743             }
       
   744         return KErrNone;	
       
   745         }
       
   746 
       
   747 TInt CLibxml2Tester::TestDOMSetInputBufferL(CStifItemParser& aItem)
       
   748         {
       
   749         TPtrC pType;
       
   750         aItem.GetNextString(pType);
       
   751 	
       
   752         TPtrC pDoc;
       
   753         aItem.GetNextString(pDoc);
       
   754         
       
   755         TPtrC pBinary;
       
   756         TPtrC pFile;
       
   757         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   758             {
       
   759         aItem.GetNextString( pBinary );
       
   760         aItem.GetNextString(pFile);	
       
   761             }
       
   762         	
       
   763         TPtrC pOut;
       
   764         aItem.GetNextString(pOut);
       
   765 	
       
   766         HBufC8* buf = ReadFileL(pDoc);
       
   767         CleanupStack::PushL(buf);
       
   768 		
       
   769 //             TInt nContainers = 3;
       
   770         RFile fileHandle;
       
   771         RFs aRFs;
       
   772         aRFs.Connect();
       
   773         CleanupClosePushL( aRFs );
       
   774 	
       
   775         RArray<TXmlEngDataContainer> list;
       
   776         if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   777         {
       
   778         SetupDocumentL();	  
       
   779         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   780         CleanupStack::PushL(binbuf);
       
   781         TBufC<100> chunkName(_L("ChunkContainer") );
       
   782         TInt size = 2000;
       
   783         TInt maxSize = 10000;
       
   784         TInt offset = 0;
       
   785         TInt binarySize = CID_2().Length();
       
   786 //        TBool isReadOnly = EFalse;
       
   787         RChunk chunk;
       
   788         chunk.CreateGlobal(chunkName, size, maxSize);
       
   789         CleanupClosePushL(chunk);	
       
   790 	RFile fp;
       
   791 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   792 	CleanupClosePushL(fp); 	
       
   793         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   794         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   795         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   796         iDoc.DocumentElement().AppendChildL(bincont);   
       
   797         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   798         iDoc.DocumentElement().AppendChildL(filecont);
       
   799         CleanupClosePushL(list);	////
       
   800         iDoc.GetDataContainerList(list); 
       
   801         }	
       
   802 	
       
   803 
       
   804         RXmlEngDocument doc;
       
   805 	
       
   806        CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   807        CleanupStack::PushL( des );
       
   808        des->UseDOMImplementationL( DOM_impl);
       
   809                if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   810             {
       
   811             des->UseExternalDataL( list );
       
   812             }
       
   813        des->SetInputBuffer(buf->Des(), RetDeserializerType(pType));
       
   814        doc=des->DeserializeL();
       
   815        SaveDocumentL(doc,pOut);
       
   816           if( pType.FindF( INFOSET ) != KErrNotFound )   
       
   817             {
       
   818             CleanupStack::PopAndDestroy( 7 );
       
   819             }
       
   820             else
       
   821             {
       
   822             CleanupStack::PopAndDestroy( 3 );    
       
   823             }
       
   824        return KErrNone;	
       
   825        }
       
   826 
       
   827 TInt CLibxml2Tester::TestDOMUseExternalDataL(CStifItemParser& aItem)
       
   828 	{
       
   829  TInt err;
       
   830     TPtrC pDeserializerType;
       
   831     aItem.GetNextString( pDeserializerType );
       
   832 	
       
   833     TPtrC pInputFile;
       
   834     aItem.GetNextString( pInputFile );
       
   835 	
       
   836     TPtrC pBinary;
       
   837    TPtrC pFile;
       
   838    if( (pDeserializerType.FindF( INFOSET ) != KErrNotFound ) || (pDeserializerType.FindF( XOP ) != KErrNotFound )  )   
       
   839         {
       
   840         aItem.GetNextString( pBinary );
       
   841         aItem.GetNextString(pFile);	
       
   842         }
       
   843 	
       
   844     TPtrC pOutputFile;
       
   845     aItem.GetNextString( pOutputFile );
       
   846     
       
   847     TPtrC pDirtyReturn;
       
   848     aItem.GetNextString( pDirtyReturn );
       
   849     
       
   850     TLex inputNum (pDirtyReturn);
       
   851     TInt dirtyReturn;
       
   852      inputNum.Val(dirtyReturn);	
       
   853         
       
   854     TInt nContainers = 3;
       
   855     RFile fileHandle;
       
   856     RFs aRFs;
       
   857     aRFs.Connect();
       
   858     CleanupClosePushL( aRFs );
       
   859     RArray<TXmlEngDataContainer> list;
       
   860     if( (pDeserializerType.FindF( INFOSET ) != KErrNotFound ) || (pDeserializerType.FindF( XOP ) != KErrNotFound ) )   
       
   861         {
       
   862         SetupDocumentL();	  
       
   863         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   864         CleanupStack::PushL(binbuf);
       
   865         TBufC<100> chunkName(_L("ChunkContainer") );
       
   866         TInt size = 2000;
       
   867         TInt maxSize = 10000;
       
   868         TInt offset = 0;
       
   869         TInt binarySize = CID_2().Length();
       
   870 //        TBool isReadOnly = EFalse;
       
   871         RChunk chunk;
       
   872         chunk.CreateGlobal(chunkName, size, maxSize);
       
   873         CleanupClosePushL(chunk);	
       
   874 	RFile fp;
       
   875 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   876 	CleanupClosePushL(fp); 	
       
   877         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   878         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   879         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   880         iDoc.DocumentElement().AppendChildL(bincont);   
       
   881         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   882         iDoc.DocumentElement().AppendChildL(filecont);
       
   883         CleanupClosePushL(list);	////
       
   884         iDoc.GetDataContainerList(list); 
       
   885         }	
       
   886 	
       
   887     RXmlEngDocument doc;
       
   888     	
       
   889          CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   890         CleanupStack::PushL( des );
       
   891         des->UseDOMImplementationL( DOM_impl);
       
   892     if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   893         {
       
   894         des->UseExternalDataL( list );
       
   895         des->SetInputFileL( pInputFile,EDeserializerXOP);
       
   896         TRAP(err,doc=des->DeserializeL());
       
   897         }
       
   898     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   899         {
       
   900         des->UseExternalDataL( list );
       
   901         des->SetInputFileL( pInputFile,EDeserializerXOPInfoset );
       
   902         TRAP(err,doc=des->DeserializeL());
       
   903         }    
       
   904           
       
   905     if(list.Count() != nContainers) User::Leave(KErrGeneral);
       
   906     
       
   907     SaveDocumentL(doc,pOutputFile);
       
   908 		
       
   909     CleanupStack::PopAndDestroy( 6 ); 
       
   910     if ( err == dirtyReturn ) return KErrNone;		
       
   911     else return err;
       
   912 
       
   913 	}	
       
   914 TInt CLibxml2Tester::TestDOMExternalDataL(CStifItemParser& aItem)
       
   915 	{
       
   916  TInt err;
       
   917     TPtrC pDeserializerType;
       
   918     aItem.GetNextString( pDeserializerType );
       
   919 	
       
   920     TPtrC pInputFile;
       
   921     aItem.GetNextString( pInputFile );
       
   922 	
       
   923     TPtrC pBinary;
       
   924    TPtrC pFile;
       
   925    if( (pDeserializerType.FindF( INFOSET ) != KErrNotFound ) || (pDeserializerType.FindF( XOP ) != KErrNotFound )  )   
       
   926         {
       
   927         aItem.GetNextString( pBinary );
       
   928         aItem.GetNextString(pFile);	
       
   929         }
       
   930 	
       
   931     TPtrC pOutputFile;
       
   932     aItem.GetNextString( pOutputFile );
       
   933     
       
   934     TPtrC pDirtyReturn;
       
   935     aItem.GetNextString( pDirtyReturn );
       
   936     
       
   937     TLex inputNum (pDirtyReturn);
       
   938     TInt dirtyReturn;
       
   939      inputNum.Val(dirtyReturn);	
       
   940         
       
   941     TInt nContainers = 3;
       
   942     RFile fileHandle;
       
   943     RFs aRFs;
       
   944     aRFs.Connect();
       
   945     CleanupClosePushL( aRFs );
       
   946     RArray<TXmlEngDataContainer> list;
       
   947     if( (pDeserializerType.FindF( INFOSET ) != KErrNotFound ) || (pDeserializerType.FindF( XOP ) != KErrNotFound ) )   
       
   948         {
       
   949         SetupDocumentL();	  
       
   950         HBufC8* binbuf = ReadFileToBufferL(pBinary);
       
   951         CleanupStack::PushL(binbuf);
       
   952         TBufC<100> chunkName(_L("ChunkContainer") );
       
   953         TInt size = 2000;
       
   954         TInt maxSize = 10000;
       
   955         TInt offset = 0;
       
   956         TInt binarySize = CID_2().Length();
       
   957 //        TBool isReadOnly = EFalse;
       
   958         RChunk chunk;
       
   959         chunk.CreateGlobal(chunkName, size, maxSize);
       
   960         CleanupClosePushL(chunk);	
       
   961 	RFile fp;
       
   962 	User::LeaveIfError( fp.Open(aRFs, pFile, EFileRead) );
       
   963 	CleanupClosePushL(fp); 	
       
   964         TXmlEngBinaryContainer bincont = iDoc.CreateBinaryContainerL(CID_1(), binbuf->Des());
       
   965         TXmlEngChunkContainer chunkcont = iDoc.CreateChunkContainerL(CID_2(), chunk, offset, binarySize);
       
   966         TXmlEngFileContainer filecont = iDoc.CreateFileContainerL(CID_3(), fp);
       
   967         iDoc.DocumentElement().AppendChildL(bincont);   
       
   968         iDoc.DocumentElement().AppendChildL(chunkcont);
       
   969         iDoc.DocumentElement().AppendChildL(filecont);
       
   970         CleanupClosePushL(list);	////
       
   971         iDoc.GetDataContainerList(list); 
       
   972         }	
       
   973 	
       
   974     RXmlEngDocument doc;
       
   975     	
       
   976          CXmlEngDeserializerDOM* des = CXmlEngDeserializerDOM::NewL();
       
   977         CleanupStack::PushL( des );
       
   978         des->UseDOMImplementationL( DOM_impl);
       
   979     if( pDeserializerType.FindF( XOP ) != KErrNotFound )     
       
   980         {
       
   981         des->UseExternalDataL( list );
       
   982         des->SetInputFileL( pInputFile,EDeserializerXOP);
       
   983         TRAP(err,doc=des->DeserializeL());
       
   984         }
       
   985     else if( pDeserializerType.FindF( INFOSET ) != KErrNotFound )     
       
   986         {
       
   987         des->UseExternalDataL( list );
       
   988         des->SetInputFileL( pInputFile,EDeserializerXOPInfoset );
       
   989         TRAP(err,doc=des->DeserializeL());
       
   990         }    
       
   991           
       
   992     if(list.Count() != nContainers) User::Leave(KErrGeneral);
       
   993     
       
   994     RArray<TXmlEngDataContainer>* fromDeserializer = des->ExternalData();
       
   995     
       
   996     if(fromDeserializer->Count() != nContainers) User::Leave(KErrGeneral);	
       
   997     	for(TInt i = 0; i < nContainers; i++ )
       
   998 		{
       
   999 		if (fromDeserializer->operator[](i).NodeType() != list.operator[](i).NodeType() ) User::Leave( KErrGeneral );
       
  1000 		if (fromDeserializer->operator[](i).Size() != list.operator[](i).Size() ) User::Leave( KErrGeneral );
       
  1001 		}
       
  1002 //    fromDeserializer->Close();
       
  1003 
       
  1004     SaveDocumentL(doc,pOutputFile);
       
  1005 		
       
  1006     CleanupStack::PopAndDestroy( 6 ); 
       
  1007     if ( err == dirtyReturn ) return KErrNone;		
       
  1008     else return err;
       
  1009 
       
  1010 	}	
       
  1011 
       
  1012 // End of file