I
Ion Freeman
Hi!
I'm just trying to do the simplest thing in the world. Where input
is a java.io.File that contains an transitional XHTML 1.0 file, I do
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance
();
dbf.setNamespaceAware(false);
db = dbf.newDocumentBuilder();
Document doc = db.parse(input);
Unfortunately, this tries to pull the DTD from the W3C, and they
didn't like that. So, they give me a 503 error. I tried the
EntityResolver from http://forums.sun.com/thread.jspa?threadID=5244492,
but that just gives me a MalformedURLException. Either way, my parse
fails.
I'm sure that at least tens of thousands of people have written code
to do this, but I can't find a (working) reference online. I think
most of my XML parsing happened when the W3C would just give the DTDs
out -- I understand that they found that unworkable, but I still need
to parse my document.
How should I be doing this?
Thanks!
Ion
I'm just trying to do the simplest thing in the world. Where input
is a java.io.File that contains an transitional XHTML 1.0 file, I do
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance
();
dbf.setNamespaceAware(false);
db = dbf.newDocumentBuilder();
Document doc = db.parse(input);
Unfortunately, this tries to pull the DTD from the W3C, and they
didn't like that. So, they give me a 503 error. I tried the
EntityResolver from http://forums.sun.com/thread.jspa?threadID=5244492,
but that just gives me a MalformedURLException. Either way, my parse
fails.
I'm sure that at least tens of thousands of people have written code
to do this, but I can't find a (working) reference online. I think
most of my XML parsing happened when the W3C would just give the DTDs
out -- I understand that they found that unworkable, but I still need
to parse my document.
How should I be doing this?
Thanks!
Ion