Code example for DocumentBuilder

Methods: setEntityResolver, setErrorHandler

0
	 * 
	 * @return A new DOM parser. 
	 */ 
	public static DOMParser createDOMParser() { 
		DocumentBuilder builder = getStandardDocumentBuilder();
		builder.setEntityResolver(ENTERPRISE_ENTITY_RESOLVER);
		builder.setErrorHandler(new ErrorHandler() {
			public void error(SAXParseException ex) {
				System.err.println("Parse error: " + ex.getMessage());
				ex.printStackTrace();
			} 
			public void warning(SAXParseException ex) {
				System.err.println("Parse warning: " + ex.getMessage());
			} 
			public void fatalError(SAXParseException ex) {
				System.err.println("Fatal parse error: " + ex.getMessage());
				ex.printStackTrace();
			} 
		}); 
		return new DOMParser(builder);
	} 
 
	/** Create a SAX parser. 
	 * 
	 * This method creates a new, default SAX parser.  It's set up with a default