Code example for XMLReader

Methods: parse, setContentHandler, setFeature

0
			Handler handler = new Handler(namespaces, templates, builder, errors);
			parser.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
//			parser.parse(stream, handler); 
			 
			XMLReader xml = parser.getXMLReader();
			xml.setContentHandler(handler);
			xml.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
			xml.setFeature("http://xml.org/sax/features/validation", false);
			 
			xml.parse(new InputSource(stream));
			 
			if(errors.hasErrors())
			{ 
				throw errors.raiseException();
			} 
		} 
		catch(ParserConfigurationException e)
		{ 
			throw new TemplateException("Unable to parse XML; " + e.getMessage(), e);
		} 
		catch(SAXException e)