As I understand the question you are asking how to connect a local file as a scheme Example
Source schemaFile = new StreamSource(new ClassPathResource("datTag.xsd").getInputStream());
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schema = schemaFactory.newSchema(schemaFile);