Code example for DocumentBuilder

Methods: getDOMImplementation, parse, setErrorHandler

0
								nameSpace + " " +  
							   //"C:\\AmitK\\work\\project\\Learning\\EclipseWorkSpace\\XML\\src\\com\\amitk\\xml\\xsd\\hello\\" + schemaFileName); 
								"http://10.8.4.118:9050/MILOrderTrackEEM/static/Order.xsd"); 
			*/ 
			DocumentBuilder builder = dbf.newDocumentBuilder();
			System.out.println("Document builder impl:" + builder.getDOMImplementation().getClass().getName());
 
			errorHander = new Validator();
			builder.setErrorHandler(errorHander);
			//parser.setProperty(name, value)ErrorHandler(errorHander); 
			//parser.parse("src/com/amitk/xml/xsd/hello/" + xmlFileName, errorHander); 
			builder.parse("src/com/amitk/xml/xsd/hello/" + xmlFileName);
 
			if (errorHander.hasErrors()) {
				//errorHander.saxParseException.printStackTrace(); 
				System.out.println(errorHander.getErrors());
			} else { 
				System.out.println("xml file parsed successfully");
			} 
		}catch (Exception e) {
			e.printStackTrace();