Hi
Christian,
Set an
EntityResolver to the parser, and return a null from within resolveEntity()
method, for the URI that you wish to ignore.
Cheers,
Rahul.
-----Original Message-----
From: Christian Lebaudy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 15, 2003 2:02 PM
To: [EMAIL PROTECTED]
Subject: DTD access over the internet
Hello, i am having trouble to parse a very simple document that has a <!DOCTYPE section with an http link over the internet.I do not want to acces internetI do not want to have to cut the XML file to get the DOCTYPE section out of itI simply want to parse the document.I am using : DOMParser parser = new DOMParser();I try following features but the java application want always to open a connection to the internet :// deactivating parser XML-DTD validation
parser.setFeature("http://xml.org/sax/features/validation",false);
// deactivating Xerces SAX parser DTD-file definition load
parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false);
// deactivating Xerces SAX parser grammar DTD-file definition load
parser.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar",false);
parser.setFeature("http://apache.org/xml/features/validation/schema",false);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",false);
parser.setFeature("http://apache.org/xml/features/validation/dynamic",false);
parser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation",new File(".").getCanonicalPath());I did not thought that i should have an internet connection to parse a document.Does anyone knows how to tell to Xerces that I only want to parse a local document ?thanks in advance
