Automation

I used ANT to connect together the XProc pre-processing step and XSpec's standard steps (compile, evaluate, report, summarise), which are already written in ANT. XSpec actually includes an XProc 1.0 pipeline for running tests (as an alternative to ANT) but my pre-processing step was written using XProc 3.1 - and XProc 1.0 steps are incompatible with XProc 3.0+ steps. It wasn’t possible to downgrade the pre-processing step to version 1.0 because it doesn’t support the p:ixml step, which the pre-processing step depends on.

I used XProc instead of ANT for the pre-processing step because it's usually easier to make changes to an XML file using XProc or XSLT. MorganaXProc-III SE supports the XProc 3.1 p:ixml step, for carrying out the iXML transformation, whereas the invisible-xml function in XSLT 4.0 isn't yet supported by an XSLT processor. However, the pre-processing step does still include two XSLT transformations. It’s so easy to use XSLT within XProc that when writing XProc, if I already know how to achieve something using XSLT, I tend to mix the two together rather than checking to see if a more efficient approach is possible simply using out-of-the-box XProc. Although, once something is working, given time and opportunity, I do often review and reflect on my code and explore whether there are other potentially more suitable options available and refactor to use them instead, eg. p:add-attribute and p:namespace-rename.