class CommonsXsdSchemaCollection implements XsdSchemaCollection, InitializingBean, ResourceLoaderAware {

	@Override
	public XmlValidator createValidator() {
		try {
			Resource[] resources = new Resource[xmlSchemas.size()];
			for (int i = xmlSchemas.size() - 1; i >= 0; i--) {
				XmlSchema xmlSchema = xmlSchemas.get(i);
				String sourceUri = xmlSchema.getSourceURI();
				if (StringUtils.hasLength(sourceUri)) {
					resources[i] = new UrlResource(sourceUri);
				}
			}
			return XmlValidatorFactory.createValidator(resources, XmlValidatorFactory.SCHEMA_W3C_XML);
		} catch (IOException ex) {
			throw new CommonsXsdSchemaException(ex.getMessage(), ex);
		}
	}

	public  CommonsXsdSchemaCollection();
	public  CommonsXsdSchemaCollection(Resource... resources);

}