Based on @Michael Kay's comment, switching the XSLT processor from Xalan to Saxon solves this problem. You have to add saxon-he-12.5.jar
and xmlresolver-5.2.2.jar
from Saxon-HE 12.5 to the classpath, and set the system property with -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl
. This solution has the advantage of requiring no changes to the source code.