* @return The handler for chaining
*/
public static <CTX extends XMLContext, D extends IXMLDocument<CTX>> CTX parse (IInputSource input, D handler, CTX context) {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
XMLReader<CTX> xmlHandler = new XMLReader<CTX>(handler, context);
org.xml.sax.XMLReader reader = parser.getXMLReader();
reader.setContentHandler(xmlHandler);
reader.setDTDHandler(xmlHandler);
reader.setEntityResolver(xmlHandler);
reader.setErrorHandler(xmlHandler);