if (validationInfo == null || validationInfo.size() == 0) {
addElement(info, Edit.Info.Elem.VALID, "-1");
} else {
String isValid = "1";
for (Object elem : validationInfo) {
MetadataValidation vi = (MetadataValidation) elem;
String type = vi.getId().getValidationType();
if (!vi.isValid()) {
isValid = "0";
}
String ratio = "xsd".equals(type) ? "" : vi.getFailed() + "/" + vi.getTested();
info.addContent(new Element(Edit.Info.Elem.VALID + "_details").
addContent(new Element("type").setText(type)).
addContent(new Element("status").setText(vi.isValid() ? "1" : "0")).
addContent(new Element("ratio").setText(ratio))
);
}
addElement(info, Edit.Info.Elem.VALID, isValid);
}