src/main/java/de/alpharogroup/xsd/schema/ValidatorExtensions.java
public static void validateSchema(final File xsd, final File xml,
		final ErrorHandler errorHandler)
		throws SAXException, ParserConfigurationException, IOException
	{

		final Schema schemaXSD = getSchema(xsd, errorHandler);

		// Create a Validator capable of validating XML files according to my custom schema.
		final Validator validator = schemaXSD.newValidator();

		// parse the XML DOM tree againts the stricter XSD schema
		validator.validate(getDOMSource(xml, errorHandler));
	}
public static void validateSchema(final File xsd, final File xml,
		final ErrorHandler errorHandler)
		throws SAXException, ParserConfigurationException, IOException
	{

		final Schema schemaXSD = getSchema(xsd, errorHandler);

		// Create a Validator capable of validating XML files according to my custom schema.
		final Validator validator = schemaXSD.newValidator();

		// parse the XML DOM tree againts the stricter XSD schema
		validator.validate(getDOMSource(xml, errorHandler));
	}
Validate xml through xsd.

@param xsd
the xsd
@param xml
the xml
@param errorHandler
the error handler
@throws SAXException
If a SAX error occurs during parsing.
@throws ParserConfigurationException
if a DocumentBuilder cannot be created which satisfies the configuration
requested.
@throws IOException
Signals that an I/O exception has occurred.