Bug #5606
closedDuplicate source error message in exception (Saxon 11)
100%
Description
In the method net.sf.saxon.resource.ActiveSAXSource.deliver(Receiver, ParseOptions) there is this throw:
throw new XPathException("I/O error reported by XML parser processing " +
getSystemId() + ": " + err.getMessage(), err);
which adds the source message to the initial message. But the method "net.sf.saxon.trans.XPathException.getMessage()" again uses the exception source message. So you end up with a reported error message which contains the same message twice like:
I/O error reported by XML parser processing : file not found: file not found
Related issues
Updated by Michael Kay over 2 years ago
- Related to Bug #5561: misleading error message on failure to find external DTD added
Updated by Michael Kay over 2 years ago
- Category set to Diagnostics
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch 11, trunk added
- Fix Committed on Branch 11, trunk added
Fixed as suggested. Tested as follows: ran from the command line, with a source document whose DOCTYPE points to a non-existent DTD file.
On SaxonJ the message is now:
I/O error reported by XML parser processing file:/Users/xxxx...../samples/data/books.xml: /Users/xxxx...../samples/data/bookszz.dtd (No such file or directory)
On SaxonCS the message is:
Error reported by XML parser processing file:///Users/xxxx...../samples/data/books.xml: Cannot resolve external DTD subset - public ID = '', system ID = 'bookszz.dtd'.
Updated by Debbie Lockett over 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.4 added
Bug fix applied in the Saxon 11.4 maintenance release.
Updated by Radu Coravu over 2 years ago
I think my judgement about this was wrong, the method "XPathException.getMessage()" actually seems to be filtered out by your custom compilation process when the Java JAR library is created, the method is there only for the CSharp distribution.
So the code which added the error message to the initial exception error message in ActiveSAXSource.deliver was probably correct as it was, at least for the Java Saxon Library.
Updated by Michael Kay over 2 years ago
I'm comfortable that the change I made should be OK for all platforms.
Please register to edit this issue