ContentHandler handler = new WhitespaceStripper(dombuilder, errorReceiver, entityResolver);
handler = new VersionChecker(handler, errorReceiver, entityResolver);
// insert the reference finder so that
// included/imported schemas will be also parsed
XMLFilterImpl f = logic.createExternalReferenceFinder(this);
f.setContentHandler(handler);
if (errorReceiver != null)
f.setErrorHandler(errorReceiver);
f.setEntityResolver(entityResolver);
reader.setContentHandler(f);
if (errorReceiver != null)
reader.setErrorHandler(errorReceiver);
reader.setEntityResolver(entityResolver);