I'm trying to get the Parser to check only for well-formness and ignore
external Entities. I've set the option to disable the default entity
resolver and overridden the resovler to return NULL, but the Parser
still attempts to open the DTD referenced in the document.
Since the DTD is not local, the Parser reports::
Parser Error Message: An exception occurred!
Type:RuntimeException, Message:Could not open DTD file
Code snippet:
/* This method gives users the option to not perform default
entity
* resolution. If the user's resolveEntity method returns
NULL the
* parser will try to resolve the entity on its own. When
this option
* is set to true, the parser will not attempt to resolve
the entity
* when the resolveEntity method returns NULL.
*/
_XmlDOMParser->setDisableDefaultEntityResolution(true);
//turn off the features to allow validation by
Schema/DTD
_XmlDOMParser->setValidationScheme(_XmlDOMParser->Val_Never);//turn off
validation
_XmlDOMParser->setDoSchema(false);//disable the parser's
schema processing.
_XmlDOMParser->setDisableDefaultEntityResolution(true);//disable default
entity resolution
_XmlDOMParser->setSkipDTDValidation(true);