use of eu.esdihumboldt.hale.io.xml.validator.XmlInstanceValidator in project hale by halestudio.
the class StreamGmlWriterTest method validate.
/**
* Validate an XML file against the given schemas.
*
* @param xmlLocation the location of the XML file
* @param validationSchemas schemas needed for validation
* @return the validation report
* @throws IOProviderConfigurationException if the validator is not
* configured correctly
* @throws IOException if I/O operations fail
*/
public static IOReport validate(URI xmlLocation, List<? extends Locatable> validationSchemas) throws IOProviderConfigurationException, IOException {
XmlInstanceValidator validator = new XmlInstanceValidator();
validator.setSchemas(validationSchemas.toArray(new Locatable[validationSchemas.size()]));
validator.setSource(new DefaultInputSupplier(xmlLocation));
return validator.execute(null);
}
Aggregations