Bug #4650
closedErrors not reported when validating XSL using Saxon EE anda configuration file
0%
Description
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 9.9.1.7.
Files
Updated by Radu Coravu over 4 years ago
Any hints on this? We wanted to consider including a fix in a minor bug fix release.
Updated by Michael Kay over 4 years 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="http://saxon.sf.net/ns/configuration">
<global optimizationLevel="-j"/>
</configuration>
(though oXygen 21.0 objects to this, saying optimizationLevel
must be an integer).
I tried adding
configuration.getDefaultXsltCompilerInfo().setJustInTimeCompilation(false);
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.
Updated by Michael Kay over 4 years 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.
Updated by Octavian Nadolu over 4 years 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.
Updated by Michael Kay about 4 years 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