question: private static boolean verifyXML ( String fileName ) { SchemaFactory sf = SchemaFactory . newInstance ( W3C_XML_SCHEMA ) ; Source xsdFile = new StreamSource ( new File ( XSD_FILE_PATH ) ) ; Source xmlFile = new StreamSource ( new File ( fileName ) ) ; boolean validXML = false ; try { Schema schema = sf . newSchema ( xsdFile ) ; Validator validator = schema . newValidator ( ) ; try { validator . validate ( xmlFile ) ; validXML = true ; } catch ( IOException e ) { e . printStackTrace ( ) ; } if ( ! validXML ) { new IOException ( "File isn't  valid against the xsd" ) ; } } catch ( SAXException e ) { e . printStackTrace ( ) ; } return validXML ; }
target:  Checks whether the given XML is valid against the XSD for the new data format.