Project

Profile

Help

Patch #1422

closed

Add flag to disable reporting of ambiguities

Added by Anonymous almost 18 years ago. Updated about 12 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Internals
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

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

Description

SourceForge user: proyal

The attached patch adds a constant to FeatureKeys that controls whether

or not ambigious matches in XSLT are reported. The default is to report

them, the current behavior.


Files

report-ambiguities.diff (9.56 KB) report-ambiguities.diff Anonymous, 2006-07-06 19:30
Actions #1

Updated by Anonymous almost 18 years ago

SourceForge user: proyal

Logged In: YES

user_id=394522

This is a patch against Saxon-B 8.7.3

Actions #2

Updated by Anonymous almost 18 years ago

SourceForge user: mhkay

Logged In: YES

user_id=251681

(1) There are six places in Mode.java where

reportAmbiguity() is called, but you only appear to have

changed one of them. Why?

(2) There is already an option RECOVERY_POLICY which

determines whether "recoverable errors" are treated as fatal

errors, warnings, or are recovered silently. Is there really

a need for control of this particular recoverable error at

finer granularity? If so, the control needs to have some

defined relationship to RECOVERY_POLICY: the two options

clearly interact in an awkward way.

(3) You can also control this by writing an ErrorListener,

which is much more flexible.

(4) Where is the documentation, and where are the test cases?

Michael Kay

Saxonica

Actions #3

Updated by Anonymous almost 18 years ago

SourceForge user: proyal

Logged In: YES

user_id=394522

Thanks for the prompt response:

  1. Pure oversight on my part.

  2. RECOVERY_POLICY doesn't seem to apply, since it won't prevent the

reporting of the ambiguity. My goal was to not report it at all, and thus save

the CPU time spent constructing the DynamicError instance.

  1. Yes, I could control this via an ErrorListener, but then I still incur the

expense of constructing the DynamicError.

  1. Documentation -- I added javadocs, but yes, I need to add patches to the

HTML documentation as well. For test cases, what is the format/style that is

used? The source distribution of Saxon-B does not include any unit tests, so I

don't have a clear pattern to follow.. How do you prefer them to be done?

Thanks. I'll clean it up as suggested.

-peter

Actions #4

Updated by Anonymous almost 18 years ago

SourceForge user: mhkay

Logged In: YES

user_id=251681

If you look at the code in Mode.java more carefully, you'll

see that at key points it tests

recoveryPolicy==RECOVER_SILENTLY. It does this quite

deliberately before constructing and throwing the exception,

indeed even before testing whether the node matches the

pattern that would cause the ambiguity to be detected and

reported. In many cases testing the pattern will be much

more expensive than constructing the exception.

Ignore my remark about documentation and tests. If the

requirements were right and the design was right and the

code was right I'd be quite happy to pick up the tedious

back-end work of issuing the thing. Start at the beginning

and convince me there is a requirement that the existing

mechanisms don't satisfy. If the objective is performance,

quantify the gains.

Apart from anything else: if you know you have an ambiguity

between two rules, then you can fix it by setting explicit

priorities. If you don't know you have an ambiguity, then

you ought to be told.

Michael Kay

Saxonica

Actions #5

Updated by Anonymous over 17 years ago

SourceForge user: proyal

Logged In: YES

user_id=394522

Followed mhkay's suggestions and just ignore in ErrorListener for now.

Please register to edit this issue

Also available in: Atom PDF