}
Iterator it = errors.iterator();
while (it.hasNext()) {
Object el = it.next();
if (el instanceof ValidationError) {
ValidationError err = (ValidationError) el;
// determine whether error or warning
String color = "yellow";
String icon = "warning_icon.gif";
if (XMLValidationError.TYPE_ERROR.equals(err.getType())) {
color = "red";
icon = "error_icon.gif";
hasError = true;
} else if (XMLValidationError.TYPE_WARNING.equals(err.getType())) {
hasWarning = true;
}
XMLElement element = Utils.getLocation(err.getElement());
// determine error message
String errorId = err.getId();
String error = ResourceManager.getLanguageDependentString(errorId);
if (error == null) {
error = errorId;
}
// determine error type, element type and name
String errorType = ResourceManager.getLanguageDependentString(err.getType() + "TypeKey");
String elementType = ResourceManager.getLanguageDependentString(element.toName() + "Key");
String name = "";
if (element instanceof XMLComplexElement) {
XMLElement idEl = (XMLElement) ((XMLComplexElement) element).get("Name");
name = (idEl != null) ? idEl.toValue() : "";