Project

Profile

Help

Bug #4099

closed

Possible two small bugs in the handling of ErrorListener

Added by Gerben Abbink about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2019-01-16
Due date:
% Done:

100%

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

Description

I have uploaded a small test program, an xml file and an xsd file to show two possible bugs in the way Saxon handles ErrorListener.

1 - Warning are always written to stderr/stdout even if there's an ErrorListener registered. Errors are not written to stderr/stdout if there's an ErrorListener registered. Is this by design or is this a bug? 2 - SchemaValidator does not stop if i throw a TransformerException in MyErrorListener.error(). This is not according to the specs of ErrorListener:

https://docs.oracle.com/javase/9/docs/api/javax/xml/transform/ErrorListener.html#error(javax.xml.transform.TransformerException)

It says: TransformerException - if the application chooses to discontinue the transformation.

If this is also by design, how do i restrict the number of errors reported?


Files

SaxonTester.java (2.63 KB) SaxonTester.java Gerben Abbink, 2019-01-16 20:43
SaxonTester.xml (194 Bytes) SaxonTester.xml Gerben Abbink, 2019-01-16 20:43
SaxonTester.xsd (206 Bytes) SaxonTester.xsd Gerben Abbink, 2019-01-16 20:43
Actions #1

Updated by Michael Kay about 5 years ago

  1. Need to ensure that the SchemaCompiler used to process a schema referenced by xsi:schemaLocation inherits the ErrorListener of the validation run rather than creating a new one. This is complicated by the fact that the primary reporting mechanism for a validator is now the InvalidityHandler, with delegation to a JAXP ErrorListener occurring only for compatibility reasons; but the ErrorListener is still primary for a SchemaCompiler.

  2. Need to change InvalidityHandlerWrappingErrorListener so that an exception returned by the underlying ErrorListener is passed on.

Actions #2

Updated by Michael Kay about 5 years ago

  • Category set to JAXP Java API
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch trunk added
  • Fix Committed on Branch 9.9, trunk added

Fixes committed on 9.9 branch and trunk.

Actions #3

Updated by O'Neil Delpratt about 5 years ago

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

Bug issue fixed in the Saxon 9.9.1.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF