Ignore DOCTYPE when parsing an XML file
843834Aug 19 2003 — edited Aug 19 2003Hi,
I have a problem when parsing an XML file. The file contains:
<!DOCTYPE ... SYSTEM 'file:///..../export.dtd'>
As the XML file originates from another server I don't have the DTD file on my filesystem. Therefore, when I parse the file using SAXP I receive an exception saying "java.io.FileNotFoundException: .....".
Have tried setValidating as below, but without any success:
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(false);
It seems as if the parser tries to find the DTD-file regardless of what setValidating is set to.
So, how do I prevent the parser to look for the DTD-file?
Thanks in advance for your help,
Christina