use of org.kie.dmn.backend.marshalling.v1x.XStreamMarshaller.DMN_VERSION in project drools by kiegroup.
the class DMNValidatorImpl method validateSchema.
private List<DMNMessage> validateSchema(String xml, String path) {
List<DMNMessage> problems = new ArrayList<>();
try {
DMN_VERSION inferDMNVersion = XStreamMarshaller.inferDMNVersion(new StringReader(xml));
Schema usingSchema = determineSchema(inferDMNVersion);
Source s = new StreamSource(new StringReader(xml));
validateSchema(s, usingSchema);
} catch (Exception e) {
problems.add(new DMNMessageImpl(DMNMessage.Severity.ERROR, MsgUtil.createMessage(Msg.FAILED_XML_VALIDATION, e.getMessage()), Msg.FAILED_XML_VALIDATION.getType(), null, e).withPath(path));
}
return problems;
}
Aggregations