Can XSLT execute a shell script at the OS level?

saxon, shell, xslt

Solution

You can call java.lang.Runtime.exec() in the same way as any other external Java function.

Problem

I have a production flow that combines XSLT and some shell scripts in about 4 steps before it reaches completion. I execute each step manually at the moment. I'm using Saxon 9 from the command line in Linux. Can I have the xsl's execute shell scripts.. instead of me? (I know I could achieve the desired result in another way with Ant or Make.. but prefer to stay in XSLT if it is not a huge effort to do so) Update: I've minimized my shell scripts and sped things up using Xproc. I'm not entirely satisfied with the result, but Xproc has improved life. Kai's suggestion below looks good.. but I have not tried it yet.

Original source