Bug #4650

Errors not reported when validating XSL using Saxon EE anda configuration file

Added by Octavian Nadolu over 1 year ago. Updated about 1 year ago.

Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:


If I try to validate the attached file "test-xsl-validation.xsl" using Saxon EE and a EE configuration file (saxonEEConfig.xml), no errors are reported. If I use Saxon PE and a PE configuration file (saxonPEConfig.xml), the error are reported correctly. I attached a zip with some sample files and the Java code to reproduce the problem. I tested with Saxon (2.37 KB) Octavian Nadolu, 2020-07-20 12:29


#1 Updated by Radu Coravu about 1 year ago

Any hints on this? We wanted to consider including a fix in a minor bug fix release.

#2 Updated by Michael Kay about 1 year ago

The reason no errors are being reported is that JIT template compilation is enabled for the Saxon-EE case.

This can be disabled by using the configuration file:

<configuration edition="EE" xmlns="">
     <global optimizationLevel="-j"/>

(though oXygen 21.0 objects to this, saying optimizationLevel must be an integer).

I tried adding


but this has no effect. It seems when the compilation is done using JAXP, the default XsltCompilerInfo held in the Configuration is not used; instead the JIT option is taken from Configuration.isJITEnabled() which it turn takes it from the optimizer options set at configuration level.

What does work is to call

configuration.setConfigurationProperty(Feature.OPTIMIZATION_LEVEL, "-j");

There's one other oddity about this program, namely that it is creating a ProfessionalTransformerFactory over an EnterpriseConfiguration. I thought that might be the cause of the trouble, but in fact it seems to work just fine, though I'm not sure the effects are predictable, and we possibly ought to prevent it.

#3 Updated by Michael Kay about 1 year ago

  • Status changed from New to In Progress

#4 Updated by Michael Kay about 1 year ago

Note, I would expect that during stylesheet development, JIT compilation of template rules should normally be disabled, since users want to see all syntax errors.

#5 Updated by Octavian Nadolu about 1 year ago

Thanks for your response. The "JIT compilation" is disabled automatically in Oxygen for validation, but only when the Saxon options are set from Oxygen. If the user adds its configuration file, we do not change its settings. We will try to disable "JIT compilation" for validation, also when a Saxon EE configuration file is set.

#6 Updated by Michael Kay about 1 year ago

  • Status changed from In Progress to Closed
  • Assignee set to Michael Kay

Closing this with no code changes.

Please register to edit this issue

Also available in: Atom PDF