99100101102103104105106107108109
else {// it returns false otherwise, // call diagnose method to see what is wrong. try { dt.checkValid(value,null); System.out.println("valid"); } catch( DatatypeException diag ) { if( diag.getMessage()==null ) {
342343344345346347348349350351352
} private static boolean checkValue( String val, String name ) { try { XSDatatype dt = DatatypeFactory.getTypeByName( name ); dt.checkValid( val, null ); } catch( DatatypeException e ) { ABox.log.info( "Failed to create " + name + ":" + e ); return false; } return true;
245246247248249250251252253254255
} } } try { typeObj.checkValid(values[i],DummyContextProvider.theInstance); d = true; } catch( DatatypeException de ) { d = false; }
284285286287288289290291292293294
for( int i=0; i<wrongs.length; i++ ) { boolean err = false; err = typeObj.isValid(wrongs[i],DummyContextProvider.theInstance); try { typeObj.checkValid(wrongs[i],DummyContextProvider.theInstance); err = true; } catch (DatatypeException de) { ; // it should throw an exception }