Support #5169
closed
Cannot set recover policy using javax.xml.transform.TransformerFactory API
Applies to branch:
10, 11, trunk
Fix Committed on Branch:
10, 11, trunk
Fixed in Maintenance Release:
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?
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.
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).
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
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?
Yes, that's correct. I've made changes to the documentation to record it as obsolete.
Great, I'm happy, I like deleting code from our side, especially if it makes the user's interface simpler.
- Status changed from New to Resolved
- Assignee set to Michael Kay
Closing this. Documentation has been improved.
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.
- 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?
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.
- 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.
- 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.
- 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.)
- 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.)
- 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