You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Nick Bastin <nb...@opnet.com> on 2004/04/06 23:57:13 UTC
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