I want to read an XML file that has a schema declaration in it.
And that's all I want to do, read it. I don't care if it's valid, but I want it to be well formed.
The problem is that the reader is trying to read the schema file, and failing.
I don't want it to even try.
I've tried disabling validation, but it still insists on trying to read the schema file.
Ideally, I'd like to do this with a stock Java 5 JDK.
Here's what I have so far, very simple:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(file);
and here's the exception I am getting back:
java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Yes, this HAPPENS to be an XHTML schema, but this isn't an "XHTML" issue, it's an XML issue. Just pointing that out so folks don't get disrtacted. And, in this case, the W3C is basically saying "don't ask for this thing, it's a silly idea", and I agree. But, again, it's a detail of the issue, not the root of it. I don't want to ask for it AT ALL
Thanx!