Bug #5606
closed
Duplicate source error message in exception (Saxon 11)
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
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 to Bug #5561: misleading error message on failure to find external DTD added
See also bug #5561, comment 5.
- 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'.
- 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.
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.
I'm comfortable that the change I made should be OK for all platforms.
Please register to edit this issue
Also available in: Atom
PDF