public static Schema getSchema ( final File xsd , final ErrorHandler errorHandler ) throws SAXException { // Create a new instance for an XSD-aware SchemaFactory final SchemaFactory schemaFactory = SchemaFactory . newInstance ( HTTP_WWW_W3_ORG_2001_XML_SCHEMA ) ; // Set the ErrorHandler implementation. schemaFactory . setErrorHandler ( errorHandler ) ; // get the custom xsd schema that describes // the required format for my XML files. return schemaFactory . newSchema ( xsd ) ; }
Gets the schema .