[xquery-talk] Re: Extending Saxon (Barxon, Fooxon, ...)

Hans-Juergen Rennau hrennau at yahoo.de
Sun Mar 20 00:12:10 PST 2011

Hi Per,

you wrote:

"Instead of using a separate ExtensionFunctionDefinition class I would
consider using Java annotations.  That would allow a single file without
cluttering up the runtime JVM, using a compact and easily-readable and 
format.  One possible issue is that writing out annotations into class
files is non-trivial, but hopefully you're your either generating Java 
or using a classfile library that can deal with annotations.  (I recently
added annotations support to gnu.bytecode, used by Kawa/Qexo.)

A disadvantage of annotations is, I suspect, that it amounts to scattering the 
information around Java sources. How is it documented which extension functions 
project members may use, and which signatures they have? If you have dedicated 
XML documents the situation is optimal. With annotations, I guess it would be 
obscure. Or am I wrong? I have no experience with writing annotations.

Would the annotations be added to the classes offering the functionality? At any 
rate I would not want them there, as the functionality should be independent of 
its being used by XPath.

Kind regards,
-- Hans-Juergen

More information about the talk mailing list