try {
SchemaTypeSystem schemaTypeSystem = XmlBeans.compileXsd(schemas, basicTypeSystem, xmlOptions);
if (errors.size() > 0) {
boolean wasError = false;
for (Iterator iterator = errors.iterator(); iterator.hasNext();) {
XmlError xmlError = (XmlError) iterator.next();
if(xmlError.getSeverity() == XmlError.SEVERITY_ERROR) {
log.error(xmlError);
wasError = true;
} else if(xmlError.getSeverity() == XmlError.SEVERITY_WARNING) {
log.warn(xmlError);
} else if(xmlError.getSeverity() == XmlError.SEVERITY_INFO) {
log.debug(xmlError);
}
}
if (wasError) {
throw new DeploymentException("Could not compile schema type system, see log for errors");