ErrorChecker errors = new ErrorChecker(); try { SAXParser parser = new SAXParser(); parser.setFeature(“http://xml.org/sax/features/validation“, true); parser.setFeature(“http://apache.org/xml/features/validation/schema“, true); parser.setFeature(“http://apache.org/xml/features/validation/schema-full-checking”,true); parser.setProperty(“http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation”,xsdFile); parser.setErrorHandler(errors); parser.parse(inputSource); } catch (Exception e) { e.printStackTrace(); }
Read more »