Sorry, I forgot to include these lines in the snippet of code I copied. ErrorHandler* errHandler = ( ErrorHandler* ) new HandlerBase(); parser->setErrorHandler ( errHandler );
So that is not the problem... - Emmanuel David Bertoni wrote: > Emmanuel Guiton wrote: >> Well, I didn't learn more ... >> Here is the code I use: >> >> XercesDOMParser* parser = new XercesDOMParser(); >> >> parser->setDoValidation(true); >> parser->setDoSchema(true); >> parser->setDoNamespaces(true); >> parser->setValidationScheme(XercesDOMParser::Val_Always); >> parser->setExternalSchemaLocation ( "http://www.elodig.fr/logs >> file:///path/schema.xsd" ); >> >> try >> { >> parser->parse ( xmlFile ); >> } >> catch (const OutOfMemoryException& toCatch ) >> { >> ... >> >> And I don't catch any error (see the xml and xsd file at the bottom : >> there are errors in the xml file). > > Errors are reported through an ErrorHandler instance. From > XercesDOMParser.hpp: > > /** Set the error handler > * > * This method allows applications to install their own error handler > * to trap error and warning messages. > * > * <i>Any previously set handler is merely dropped, since the parser > * does not own them.</i> > * > * @param handler A const pointer to the user supplied error > * handler. > * > * @see #getErrorHandler > */ > void setErrorHandler(ErrorHandler* const handler); > > If you don't set an ErrorHandler, errors are simply ignored. Take a > look at the DOMPrint sample for more information. > > Dave > > -- Directeur Elodig SARL 30-32, avenue de la République 94800 Villejuif Tel: 01 46 77 47 68 E-mail: [EMAIL PROTECTED] http://www.elodig.fr
