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 internet
I do not want to
have to cut the XML file to get the DOCTYPE section out of
it
I 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());
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
