Missing java: prefix on static extensions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Missing java: prefix on static extensions

Andrew Welch
Hi,

I've recently discovered a bug in my code where I'd missed the java prefix on the extension namespace.  I had:

xmlns:abc="com.mycomp...

instead of:

xmlns:abc="java:com.mycomp...

This went unnoticed for over a year, until we started getting the "Cannot find a matching n-arg function..." error.

The use-when="function-available()" was succeeding, but the subsequent method call was failing.

This only seems to reveal itself under certain circumstances - in the integration tests and day to day running of the application it's fine... making me wonder if Saxon tries to handle it?

(using 9.1.0.8 here)


--

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing java: prefix on static extensions

Michael Kay
From memory, Saxon 9.1 took any namespace URI and tried to extract a class name from the substring after the last "/" or ":".

Subsequently we found that this (a) led to expensive failed attempts at loading spurious classes, and (b) resulted in poor diagnostics, e.g. for regular function calls with incorrect URIs. So we introduced the "java:" URI scheme, together with a configuration flag FeatureKeys.ALLOW_OLD_JAVA_URI_FORMAT to retain the old behaviour.

Michael Kay
Saxonica




> On 13 Jul 2017, at 10:16, Andrew Welch <[hidden email]> wrote:
>
> Hi,
>
> I've recently discovered a bug in my code where I'd missed the java prefix on the extension namespace.  I had:
>
> xmlns:abc="com.mycomp...
>
> instead of:
>
> xmlns:abc="java:com.mycomp...
>
> This went unnoticed for over a year, until we started getting the "Cannot find a matching n-arg function..." error.
>
> The use-when="function-available()" was succeeding, but the subsequent method call was failing.
>
> This only seems to reveal itself under certain circumstances - in the integration tests and day to day running of the application it's fine... making me wonder if Saxon tries to handle it?
>
> (using 9.1.0.8 here)
>
>
> --
> Andrew Welch
> http://andrewjwelch.com
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...