Hi, In the following code I attempt to parse an xml file which contains a DOCTYPE definition.
parser->setValidationScheme(XercesDOMParser::Val_Never); parser->parse(gXmlFile); <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE collection SYSTEM "C:\this file mya or may not exist and xerces should not check.dtd"> <collection> ... </collection> the schema mentioned in this definition may or may not be available at the time of parsing. For this reason I want xerces to ignore the file mentioned and to continue parsing without validation. However using: parser->setValidationScheme(XercesDOMParser::Val_Never); Only seems to turn off validation, it does not stop xerces from checking that the schema referenced is a legitimate one. and so every time i try to parse an xml file with a dtd that does not exist yet i get the following error: Fatal Error at file "C:\valid.xml", line 2, column 41 Message: An exception occurred! Type:RuntimeException, Message:Could not open DTD file 'C:\dd.dtd' Is there any way to stop xerces performing this check and ignore the missing dtd compleatly?
