DocumentHandler handler = new DocumentHandler(ruby);
// XMLReader reader = XMLReaderFactory.createXMLReader();
config.setDocumentHandler(handler);
config.setDTDHandler(handler);
config.setErrorHandler(handler);
config.setEntityResolver(new EntityResolver2Wrapper(new NokogiriEntityResolver(ruby, null, options)));
// config.setFeature("http://xml.org/sax/features/xmlns-uris", true);
// config.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
config.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", options.dtdLoad || options.dtdValid);
return config;
}