Project

Profile

Help

Bug #798

closed

ClassCastException in extension typecheck loading template

Added by Anonymous almost 17 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

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

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

UtilityFunctions_Saxon_8_8.java (9.56 KB) UtilityFunctions_Saxon_8_8.java Anonymous, 2007-06-04 08:48
BMG-IBW2006.xsl (9.56 KB) BMG-IBW2006.xsl Anonymous, 2007-06-04 08:49
UtilityFunctions_Saxon_8_8.java (9.56 KB) UtilityFunctions_Saxon_8_8.java Anonymous, 2007-06-04 08:51
Actions #1

Updated by Anonymous almost 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

Actions #2

Updated by Anonymous almost 17 years ago

SourceForge user: spenk

Logged In: YES

user_id=1807584

Originator: YES

File Added: BMG-IBW2006.xsl

Actions #3

Updated by Anonymous almost 17 years ago

SourceForge user: spenk

Logged In: YES

user_id=1807584

Originator: YES

File Added: UtilityFunctions_Saxon_8_8.java

Actions #4

Updated by Anonymous almost 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

Also available in: Atom PDF