Jenkins validation of MoEML codebase
One of the important things we want Jenkins to do for us is validate all our XML and send an email to the last committer when a file is broken. There are several steps to this, and I'm working through them; this post will record how I set that up. Everything is run as an ant task in a file called utilities/validate.xml
.
Regular RNG validation
This is handled by Jing, through its built in support for ant tasks. You use <taskdef>
to define the task, pointing at the classname Jing provides; then you invoke that task and pass it filesets containing the files to be validated. One additional requirement is that ant needs to know where to find Jing, so I'm passing it -lib /usr/share/java
on the command line.
Schematron validation
schematron.com provides an open-source library called (currently) ant-schematron-2010-04-14.jar, which can be used in the same way as Jing; you create a <taskdef>
giving it the classname and classpath (I point directly at the jar), then invoke the task with <schematron schema="../db/data/rng/london_all.sch" failonerror="false" queryLanguageBinding="xslt2">
, again passing filesets.
Validation of embedded Schematron inside the RNG
schematron.com provides XSLT tools to extract the Schematron and convert it to a full Schematron file, so I'm using their ExtractSchFromRNG-2.xsl with Saxon to generate another Schematron file, then validating our tree against that.
Diagnostics
Our regular diagnostics process is now quite sophisticated, and that's also running and producing an archived report in HTML format.
One minor improvement over the TEI setup is that I can store the log parse rules file directly in the repo, meaning that a fix to it is automatically inherited at the next checkout/job run. Right now I'm not doing anything useful in that file, but I'm sure as we continue to enhance our Schematron, especially with regard to bibls, we will need to suppress some specific messages.