Some advice on how to implement a validator for MRRT Report templates.

Hi all

I am currently working on RAD-334. MrrtReportTemplates should be validated before importing them. The validation rules are specified by the MRRT standards here,

The idea here is to validate it using xsd. Here is a commit of the current work I’ve done. According to the standard on page 33 of the doc above, exactly 1 meta tag should have the ‘charset’ attribute specifying the character set to use. There are other ‘meta’ elements that have other attributes but only one should have the charset. Apparently that cannot be made possible with xsd 1.0 only in xsd 1.1. But standard java does not support xsd 1.1. In my commit I used a valid template according to the mrrt standard but I had to comment out this line for it to work. As it is not possible to enforce that only one element have a particular attribute in xsd 1.0. The only two libraries I could find was xerces and saxon. The only version of xerces that supports xsd 1.1 is Xerces2 Java 2.11.0 (XML Schema 1.1) (Beta). But unfortunately it does not have an official maven repo. You’ll have to download the zip and install it to your local maven repo. Which is not a good idea. Also saxon has a tight license. The version of saxon that supports xsd 1.1 is not free, also not appropriate for us. So me and @teleivo would love some input from the community on how to tackle this. Maybe there is something we missed.

Update: You can look at this question I asked on stackoverflow to understand fully the problem am trying to solve,

Apart from having to install it into your local maven repository, does it work well? I remember that we have a few artifacts (like mysql-connector-mxj and mysql-connector-mxj-dbfiles) that we install into our nexus.

Seeing this just now. Theoretically it should work. But I have not tried it. We used a temporary different approach. But I’ll try and give you feedback.