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: Parser not failing on bad schema?
Date Tue, 06 Apr 2004 22:08:48 GMT
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:nbastin@opnet.com] 
Sent: Tuesday, April 06, 2004 2:57 PM
To: xerces-c-dev@xml.apache.org
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



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