In the following code:
private Document transformDoc(Source source) throws TransformerException, IOException {
TransformerFactory factory = TransformerFa
This post from the Xalan-J mailing list suggests that "the right way" is for you to configure the underlying Source
/Reader
yourself to disable validation.
Either disable DTD resolving in the parser (parser-specific) or set an empty entity resolver.
Copied from http://www.jdom.org/docs/faq.html#a0350:
public class NoOpEntityResolver implements EntityResolver {
public InputSource resolveEntity(String publicId, String systemId) {
return new InputSource(new StringBufferInputStream(""));
}
}
// Then in the builder...
builder.setEntityResolver(new NoOpEntityResolver());