xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bovy, Stephen J" <STEPHEN.B...@ca.com>
Subject RE:IN memory Parse with DOMInputSource ?????
Date Fri, 16 Apr 2004 23:08:30 GMT

I am trying to write some flexable code that can
either do a file parse or an in memory parse, but I am getting a 
compile error  on : doc = sstate->doc =
sstate->parser->parse(*memBufIS);  

See below:

****************************************** 
if ( sfile.ipc ) {                              
                                                
  sstate->pathName [ 0]  = 0;                     
                                                
  sfile.ipc->pbuff  [sfile.ipc->leng]  = 0;       
                                                
  memBufIS = new MemBufInputSource              
  (                                             
      (const XMLByte*) sfile.ipc->pbuff         
      , sfile.ipc->leng                         
      , gMemBufId                               
      , false                                   
  );                                            
                                                
  if ( memBufIS == NULL ) {                     
   hcsRet->code = 8;                            
   hcsRet->reas = 0;                            
   throw 8;                                     
  } // endif no memory available                
                                                
} // endif in-memory parse                      

// Instantiate the DOM parser.                                      
static const XMLCh gLS   = { chLatin_L, chLatin_S, chNull };        
sstate->impl = DOMImplementationRegistry::getDOMImplementation(gLS);
sstate->parser =                                                    
  ((DOMImplementationLS*)sstate->impl)->                            
  createDOMBuilder ( DOMImplementationLS::MODE_SYNCHRONOUS, 0 );    
                                                                    
sstate->parser->setFeature ( XMLUni::fgDOMNamespaces, doNamespaces);
sstate->parser->setFeature ( XMLUni::fgXercesSchema, doSchema );    
sstate->parser->setFeature ( XMLUni::fgXercesSchemaFullChecking,    
                             schemaFullChecking);                   

try                                                          
{                                                            
    // reset document pool                                   
    sstate->parser->resetDocumentPool();                     
                                                             
    if ( sfile.ipc ) {                                       
      doc = sstate->doc = sstate->parser->parse(*memBufIS);  
    } else {                                                 
      doc = sstate->doc = sstate->parser->parseURI(xmlFile); 
    } // endif in memory parse                               

} catch {
*******************************
Basically I am trying to merge the code between DOMPrint and MemParse

and there are some obvious differences that I do not comprehend.

How do I create an in memory parse with  DOMInputSource ????

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Mime
View raw message