You forgot to set the error handler, at least , its not in the code snippet you posted.
parser->setErrorHandler ( errorHandler ); -----Original Message----- From: Nick Bastin [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 2:57 PM To: [EMAIL PROTECTED] Subject: Parser not failing on bad schema? How is the DOMBuilder supposed to indicate that a document did not validate? I have the following code: DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(Xus("LS")); DOMBuilder *dom_parser = ((DOMImplementationLS*)impl)->createDOMBuilder (DOMImplementationLS::MODE_SYNCHRONOUS, NULL); dom_parser->setFeature (XMLUni::fgDOMNamespaces, true); dom_parser->setFeature (XMLUni::fgXercesSchema, true); dom_parser->setFeature (XMLUni::fgXercesSchemaFullChecking, true); dom_parser->setFeature (XMLUni::fgDOMValidation, true); DOMDocument *template_doc = dom_parser->parseURI (path); From my reading of the documentation, this should not accept any documents that do not have some sort of schema/dtd specified (or at least that's how I read the 'validation' feature statement that 'if this feature is set to true, the document must specify a grammar'), and should validate all remaining documents against the specified schema. However, in reality, all documents are being parsed, regardless of whether they specify a schema, or even conform to that schema. Is there something I'm missing? I even broke some documents so that they should not validate against their schema, but they still get through the parser. The error handler reports no errors, as well. -- Nick --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
