Project

Profile

Help

Bug #4650

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

Added by Octavian Nadolu 26 days ago. Updated 19 days ago.

Status:
In Progress
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2020-07-20
Due date:
% Done:

0%

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

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.

SaxonTest.zip (2.37 KB) SaxonTest.zip Octavian Nadolu, 2020-07-20 12:29

History

#1 Updated by Radu Coravu 23 days ago

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

#2 Updated by Michael Kay 22 days 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.

#3 Updated by Michael Kay 22 days ago

  • Status changed from New to In Progress

#4 Updated by Michael Kay 22 days 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 19 days 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.

Please register to edit this issue

Also available in: Atom PDF