#697 ClassCastException in extension typecheck loading template

v8.9
closed
5
2012-10-08
2007-06-04
Henk Spaan
No

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.

Discussion

  • Henk Spaan

    Henk Spaan - 2007-06-04

    Template

     
  • Henk Spaan

    Henk Spaan - 2007-06-04

    Logged In: YES
    user_id=1807584
    Originator: YES

    Please raise Saxon bug reports via the list saxon-
    help@lists.sourceforge.net.

    The bug register is not intended for users to raise suspected
    problems, but for acknowledged known errors.

    Mike Kay

     
  • Henk Spaan

    Henk Spaan - 2007-06-04

    Logged In: YES
    user_id=1807584
    Originator: YES

    File Added: BMG-IBW2006.xsl

     
  • Henk Spaan

    Henk Spaan - 2007-06-04

    Logged In: YES
    user_id=1807584
    Originator: YES

    File Added: UtilityFunctions_Saxon_8_8.java

     
  • Michael Kay

    Michael Kay - 2007-06-04

    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.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks