Code example for Validator

Methods: validate

0
    	SchemaFactory sf=SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
    	Schema schema=sf.newSchema(new StreamSource(schemaIn));
    	Validator validator=schema.newValidator();
    	StringBuilder errorBuilder=new StringBuilder();
    	try{ 
    		validator.validate(new StreamSource(new StringReader(xml)));
    	}catch (Exception e) {
    		e.printStackTrace();
    		fail("Error during validation of XML:\n" + e.getLocalizedMessage());
		} 
    } 
 
 
    /** 
     * Explicit RELS-EXT relation to collection object 
     * @throws Exception 
     */ 
    public void testRISearchRelsExtCollection() throws Exception { 
        FedoraClient client = getFedoraClient();
        String collectionPid = "demo:SmileyStuff";
Stop searching for code, let great code find you!  Add Codota to your java IDE