I looked at Xerces source code and found the solution :

parser->setExitOnFirstFatalError(true);


Regards,

Philippe HAUTION wrote:

> Hello,
>
> Is there a trick to force the parser to throw an exception when the 
> schema file can't be located ?
>
> The only way I found to diagnose this probleme so far was to check the 
> root DOMElement returned by doc->getDocumentElement();
>
> after setting all these parser options :
>
> parser->setValidationScheme(XercesDOMParser::Val_Always);
> parser->setValidationSchemaFullChecking(true);
> parser->setDoNamespaces(true);   parser->setDoSchema(true);
> parser->setValidationConstraintFatal(true);
>
> Then if the parser can't be found, doc->getDocumentElement() will 
> return NULL.
> If parser->setValidationConstraintFatal(true); is not used, the parser 
> won't complain at all ...
>
> Is there a better way ?
>
> Regards,
>

-- 
Philippe Haution
EDF R&D
Département Méthodes d'Optimisation et de Simulation
1 Av du Général de Gaulle
92141 Clamart CEDEX




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to