Hycel, I ran into this problem on a project on which I was using dom4j
(very much in agreement about dom4j, by the way). I asked about the
issue on the dom4j list and got a couple responses.
You can probably find the whole thread if you search for the archives
online, but I saved a couple of the emails...
Here's what Mark Priest said:
<quote>
The way you would do this depends on the parser you are using. There is
no standard way to use a parser feature like caching grammars.
For Xerces, see http://xerces.apache.org/xerces2-j/faq-grammars.html#faq-1
</quote>
And here's what Edwin Dankert said
<quote>
Another way would be to override the EntityResolver, and set
it on the underlying XMLReader or DocumentBuilder ...
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
public class LocalResolver implements EntityResolver
public InputSource resolveEntity( String publicId, String systemId) {
if ( systemId.equals( "http://www.foo.org/bar.dtd")) {
return new InputSource( "bar.dtd");
} else {
return null;
}
}
}
</quote>
Bottom line is that it's not really dom4j's fault, but the underlying
parser being used.
good luck,
b
Hycel Taylor wrote:
We think you may be correct. Since this problem only occurred when
the Apache web site went down, it was our first reaction in all the
confusion. Initially, we also did not understand that IBatis
validates from the jar at run time. It's not that we don't want to
validate our IBatis sqlmaps. We would just prefer to do it locally.
At this point where looking at a way to toggle validation on and off.
In the event that Apache should go down again, we will simply turn off
validation checking.
Thank you, very much, for your consideration and support in this matter.