public static void validateInstance(Document d, LSResourceResolver iepdResourceResolver, List<String> schemaPathList) throws SAXException, Exception {
		SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        schemaFactory.setResourceResolver(iepdResourceResolver);
        List<Source> sourceList = new ArrayList<Source>();
        for (String schemaPath : schemaPathList) {
        	InputStream schemaInStream = XmlUtils.class.getClassLoader().getResourceAsStream(schemaPath);
        	StreamSource schemaStreamSource = new StreamSource(schemaInStream);
        	sourceList.add(schemaStreamSource);        	
        }
        Source[] schemaSourcesArray = sourceList.toArray(new Source[]{});
        try {        	
            Schema schema = schemaFactory.newSchema(schemaSourcesArray);        
            Validator validator = schema.newValidator();
            validator.validate(new DOMSource(d));
        } catch (Exception e) {
            try {
                e.printStackTrace();
                System.err.println("Input document:");
                XmlUtils.printNode(d);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            throw e;
        }
	}
public static void validateInstance(Document d, LSResourceResolver iepdResourceResolver, List<String> schemaPathList) throws SAXException, Exception {
		SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        schemaFactory.setResourceResolver(iepdResourceResolver);
        List<Source> sourceList = new ArrayList<Source>();
        for (String schemaPath : schemaPathList) {
        	InputStream schemaInStream = XmlUtils.class.getClassLoader().getResourceAsStream(schemaPath);
        	StreamSource schemaStreamSource = new StreamSource(schemaInStream);
        	sourceList.add(schemaStreamSource);        	
        }
        Source[] schemaSourcesArray = sourceList.toArray(new Source[]{});
        try {        	
            Schema schema = schemaFactory.newSchema(schemaSourcesArray);        
            Validator validator = schema.newValidator();
            validator.validate(new DOMSource(d));
        } catch (Exception e) {
            try {
                e.printStackTrace();
                System.err.println("Input document:");
                XmlUtils.printNode(d);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            throw e;
        }
	}
public static void validateinstance(document d, lsresourceresolver iepdresourceresolver, list<string> schemapathlist) throws saxexception, exception { schemafactory schemafactory = schemafactory.newinstance(xmlconstants.w3c_xml_schema_ns_uri); schemafactory.setresourceresolver(iepdresourceresolver); list<source> sourcelist = new arraylist<source>(); for (string schemapath : schemapathlist) { inputstream schemainstream = xmlutils.class.getclassloader().getresourceasstream(schemapath); streamsource schemastreamsource = new streamsource(schemainstream); sourcelist.add(schemastreamsource); } source[] schemasourcesarray = sourcelist.toarray(new source[]{}); try { schema schema = schemafactory.newschema(schemasourcesarray); validator validator = schema.newvalidator(); validator.validate(new domsource(d)); } catch (exception e) { try { e.printstacktrace(); system.err.println("input document:"); xmlutils.printnode(d); } catch (exception e1) { e1.printstacktrace(); } throw e; } }