Bug #798
closedClassCastException in extension typecheck loading template
0%
Description
SourceForge user: spenk
I found a ClassCastException which might have been resolved by your patch for bug 1692540, but as you state the problem is compounded to the .Net implementation, I'm not sure you solved it for Java.
The exception occurs during function 'typeCheck' when loading the template (second attachment).
The release I'm using is 8.9.0.3.
This code worked without problem in version 8.8.
Files
Updated by Anonymous over 17 years ago
SourceForge user: spenk
Logged In: YES
user_id=1807584
Originator: YES
Please raise Saxon bug reports via the list saxon-
The bug register is not intended for users to raise suspected
problems, but for acknowledged known errors.
Mike Kay
Updated by Anonymous over 17 years ago
SourceForge user: spenk
Logged In: YES
user_id=1807584
Originator: YES
File Added: BMG-IBW2006.xsl
Updated by Anonymous over 17 years ago
SourceForge user: spenk
Logged In: YES
user_id=1807584
Originator: YES
File Added: UtilityFunctions_Saxon_8_8.java
Updated by Anonymous over 17 years ago
SourceForge user: mhkay
Logged In: YES
user_id=251681
Originator: NO
As you suspected this is a duplicate of 1692540. I'm closing it now: if you want to discuss it further, please use the saxon-help list. As stated on the front page of the bugs tracker, I prefer to use this section of the site only for known confirmed problems as it makes it more useful to people doing searches.
Your extension function is declared to return "Object", but the XSLT code is trying to use the result as a string. At run-time the function sometimes returns a string and sometimes an array of characters. Saxon won't be able to cope with this, it certainly won't treat the array of characters as a string. I'd suggest declaring the return type as String (and of course always returning a string). I would also suggest (a) declaring the type of the variable (as="xs:string"), and (b) changing the stylesheet version to "2.0", all of which gives you stronger compile-time type checking.
Please register to edit this issue