Project

Profile

Help

Support #5169

closed

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

Added by Radu Coravu over 2 years ago. Updated about 1 year ago.

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

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, trunk
Fix Committed on Branch:
10, 11, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

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 over 2 years 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 over 2 years 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 over 2 years 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 over 2 years 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 over 2 years ago

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

Actions #6

Updated by Radu Coravu over 2 years 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 over 2 years ago

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

Closing this. Documentation has been improved.

Actions #8

Updated by Radu Coravu over 2 years 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 about 2 years 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 about 2 years 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.

Actions #11

Updated by Michael Kay almost 2 years ago

  • Status changed from In Progress to Resolved
  • Applies to branch 11, trunk added
  • Fix Committed on Branch 11, trunk added
  • Platforms .NET, Java added

I have made the required updates to the configuration schema, examples, and documentation on the 11.x and 12.x branches.

Actions #12

Updated by Debbie Lockett almost 2 years ago

  • Applies to branch 10 added
  • Fix Committed on Branch 10 added

Latest updates to the configuration schema, examples, and documentation, copied to the 10 branch too.

Actions #13

Updated by Debbie Lockett over 1 year ago

  • Fixed in Maintenance Release 11.4 added

Bug fix applied in the Saxon 11.4 maintenance release. (Issue remains open awaiting Saxon 10 maintenance release.)

Actions #14

Updated by O'Neil Delpratt over 1 year ago

  • Fixed in Maintenance Release 12.0 added

Bug fix applied in the Saxon 12.0 major release. (Issue remains open awaiting Saxon 10 maintenance release.)

Actions #15

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.9 added

Bug fix applied in the Saxon 10.9 maintenance release.

Please register to edit this issue

Also available in: Atom PDF