You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Chen, Patrick" <Pa...@ca.com> on 2000/07/21 17:22:01 UTC

Selective Doctype validation

Hi Im  trying to figure out how to get the DOMParser to ignore the <!DOCTYPE
tag. The original problem is that I want to process various xml files, but
since Im behind a firewall I want to ignore those that include doctypes that
reference external DTDs. For now I'll be happy with just ignoring the
<!DOCTYPE> so i can do a demonstration with "real world" xml files.

I thought these lines would shut off validation but they dont seem to work
parser.setFeature("http://xml.org/sax/features/validation",false);
parser.setFeature("http://apache.org/xml/features/validation/schema",false);
parser.setFeature("http://apache.org/xml/features/validation/dynamic",false)
;

I still get the following exception which looks like the parser is trying to
retrieve the DTD from the internet. Any suggestions would be greatly
appreciated.
Thanks


Exception: java.net.NoRouteToHostException: Operation timed out: no further
info
rmation
java.net.NoRouteToHostException: Operation timed out: no further information
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
        at java.net.Socket.<init>(Socket.java:269)
        at java.net.Socket.<init>(Socket.java:98)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:54)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:320)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:431)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:260)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:270)
        at sun.net.www.http.HttpClient.New(HttpClient.java:282)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:372)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:457)
        at java.net.URL.openStream(URL.java:818, Compiled Code)
        at
org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultRe
aderFactory.java:149, Compiled Code)
        at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExtern
alEntity(DefaultEntityHandler.java:747)
        at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExtern
alSubset(DefaultEntityHandler.java:566)
        at
org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScann
er.java:1121)
        at
org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDoc
umentScanner.java:2176)
        at
org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentSc
anner.java:2133, Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispa
tch(XMLDocumentScanner.java:882, Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:380, Compiled Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
        at testxmlreader.load(testxmlreader.java:31)
        at testxmlreader.main(testxmlreader.java:50)