Project

Profile

Help

Support #5169

open

Cannot set recover policy using javax.xml.transform.TransformerFactory API

Added by Radu Coravu 8 months ago. Updated 4 months ago.

Status:
In Progress
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2021-11-18
Due date:
% Done:

0%

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

Description

Working to integrate Saxon 10 with Oxygen XML Editor, sorry if I'm being rusty.

Setting something like this in our code:

transformerFactory.setAttribute(net.sf.saxon.lib.FeatureKeys.RECOVERY_POLICY,Configuration.RECOVER_WITH_WARNINGS)

does not seem to work anymore.

Somehow the recover policy would need to propagate to "net.sf.saxon.trans.SimpleMode.reportAmbiguity(Item, Rule, Rule, XPathContext)" but I do not see how it would propagate there.

Is there an alternate API to using javax.xml.transform.TransformerFactory to set the policy on the transformer?

Actions #1

Updated by Radu Coravu 8 months ago

I'm attempting to set DO_NOT_RECOVER on the FeatureKeys.RECOVERY_POLICY but still if the XSLT stylesheet has ambiguous rule matches, the transformation fails.

Actions #2

Updated by Radu Coravu 8 months ago

The method net.sf.saxon.style.XSLMode.prepareAttributes() does not seem to be called from anywhere. The new XSLMode instance is created on net.sf.saxon.style.XSLApplyTemplates.validate(ComponentDeclaration).

Actions #3

Updated by Michael Kay 8 months ago

This configuration property was introduced before the 3.0 attribute xsl:mode/@on-multiple-match came along, and the preferred way to control it is now using the 3.0 syntax.

More specifically, the configuration property controlled what happened on "recoverable errors" - a concept that existed in 1.0, was retained in much reduced form in 2.0, and no longer exists in 3.0.

As regards XSLMode.prepareAttributes(), see also bug #5118; and there's some history in bug #3184

Actions #4

Updated by Radu Coravu 8 months ago

So the "Feature.RECOVERY_POLICY" is not used at all anymore by Saxon 10, and we should remove all our settings to control the recover policy from the Oxygen user's interface, is this correct?

Actions #5

Updated by Michael Kay 8 months ago

Yes, that's correct. I've made changes to the documentation to record it as obsolete.

Actions #6

Updated by Radu Coravu 8 months ago

Great, I'm happy, I like deleting code from our side, especially if it makes the user's interface simpler.

Actions #7

Updated by Michael Kay 7 months ago

  • Status changed from New to Resolved
  • Assignee set to Michael Kay

Closing this. Documentation has been improved.

Actions #8

Updated by Radu Coravu 7 months ago

How about the command line flag -warnings silent|recover|fatal ? Is this flag no longer useful as well? It still seems to be present as an option in the Saxon 10 command line.

Actions #9

Updated by Debbie Lockett 4 months ago

  • Status changed from Resolved to In Progress

Revisiting this issue which was never actually closed; there seems to be more to follow up on.

Firstly, the documentation fixes were made on the saxon11 branch (in tools/featureKeys/FeatureKeys.xml), but not on the saxon10 branch. The changes should be retrofitted to saxon10, and the Saxon 10 documentation updated, too.

So the documentation will say that the command line option -warnings is ignored from Saxon 10. But should there be a warning if it is used? Or could it actually be fully removed as an option?

Also, xslt/@recoveryPolicy is currently still found in the configuration file schema and example (on saxon10 and saxon11 branches). I assume it is just ignored. But maybe it should actually be removed now?

Actions #10

Updated by Debbie Lockett 4 months ago

I have copied over the documentation changes to the saxon10 branch (in tools/featureKeys/FeatureKeys.xml and src/userdoc/using-xsl.xml), and updated the Saxon 10 documentation online. (See using-xsl/commandline, configuration/config-features, and Feature and FeatureKeys javadoc and dotnetdoc.)

Still to do: update configuration file example and schema.

Please register to edit this issue

Also available in: Atom PDF