Project

Profile

Help

Bug #4650

closed

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

Added by Octavian Nadolu over 4 years ago. Updated about 4 years ago.

Status:
Closed
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:
Platforms:

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

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

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.

Actions #2

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.

Actions #3

Updated by Michael Kay over 4 years ago

  • Status changed from New to In Progress
Actions #4

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.

Actions #5

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.

Actions #6

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

Also available in: Atom PDF