xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Beatrice Mirko <Mirko.Beatr...@thales-e-transactions.de>
Subject XercesDOMParser and
Date Tue, 04 Feb 2003 09:12:45 GMT
Hello,

I am using XercesDOMParser to parse xml data stored as string in a
char-array. After the call
   MyParser->parse(*memBufIS);
I get a lot of these messages
      "First-chance exception in XmlConvTest.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception."
in the debug windows of VisualStudio 6.
The parser works correctly and returns without errors.
Have I forgot something ?
Thanks in advance.
Mirko


My code looks like this:
 
  char Template[]="<?xml version='1.0' encoding='UTF-8'?> ...";
  


  const char *XMLdoc = Template;
  unsigned int DocLen = strlen(Template);

  // Init DOM Parser 
  DOMImplementation *impl =
DOMImplementationRegistry::getDOMImplementation(NULL);
  XercesDOMParser *MyParser = new XercesDOMParser;
  DOMWriter *theSerializer =
((DOMImplementationLS*)impl)->createDOMWriter();

  // And install error handler
  MyErrorHandler = new MyDOMErrorHandler;
  MyParser->setErrorHandler(MyErrorHandler);

  XercesDOMParser::ValSchemes ValScheme;
  ValScheme = XercesDOMParser::Val_Auto;

  bool doNamespaces         = true;
  bool doSchema                = true;
  bool schemaFullChecking = true;

  MyParser->setDoNamespaces(doNamespaces);
  MyParser->setDoSchema(doSchema);
  MyParser->setValidationSchemaFullChecking(schemaFullChecking); 
  MyParser->setValidationScheme(ValScheme);

  MemBufInputSource *memBufIS = new MemBufInputSource( (const XMLByte*)
XMLdoc, DocLen, (const char*) NULL, false );
  
  try
  {
    MyParser->resetDocumentPool();

    MyParser->parse(*memBufIS);  

    MyDocument = MyParser->getDocument();

    MyRootElement = MyDocument->getDocumentElement();

    delete memBufIS;
  }
catch ...


---------------------------------------------------------------------
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