Project

Profile

Help

Bug #1849

closed

ValidationException reported to ErrorListener even if in try/catch

Added by Michael Kay almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Schema-Aware processing
Sprint/Milestone:
-
Start date:
2013-07-20
Due date:
% Done:

0%

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

Description

Reported by Roger Castello on saxon-help list.

MHK response:

What's happening here is that validation errors are reported to the ErrorListener immediately (resulting in an error message), even though the error is subsequently caught. The transformation actually runs to successful completion, with the desired output, despite reporting the errors.

Changing this is tricky, because it conflicts with the requirement to be able to report multiple validation errors, especially when validating result documents. If you change the source document so that multiple ISBNs are invalid, you'll see that several errors are reported, unlike other dynamic errors where only one error gets reported. I'll have to think about the best way forward here.

The current behaviour, if not ideal from a usability perspective, is in this case conformant with the spec. However, W3C has made some recent (not yet published) refinements to the try/catch spec which will require Saxon changes in this area - specifically, validation errors can only be caught at the level of the instruction that requests validation, not at the level of the instruction which generates or discovers invalid content. So there's going to have to be some rethinking anyway. At the same time, for 9.6, I'm looking at making changes to the ErrorListener interface to move away from its use of the JAXP TransformerException; JAXP is becoming increasingly peripheral to Saxon with its design basis in XSLT 1.0.


Related issues

Related to Saxon - Bug #1872: doc-available() fails with error on XML parse errorClosedMichael Kay2013-08-27

Actions

Please register to edit this issue

Also available in: Atom PDF