Calling Java Extension Functions.
XSLT style-sheets can call Java extension functions from within the style-sheet for processing. Consider a simple case of an XSLT style-sheet calling a Java extension function to convert the argument string literal to upper case.
- The class 'string.converter.SimpleConverter.java' that does the conversion to upper case is packaged in the Jar file 'StringConverer.jar'.
- In order to access this Java extension function, the user can add this Jar file to the XSLT project as shown.
- The code in the style-sheet to call the Java extension function is as shown.
- The XSLT project is added as part of a composite application project built and compiled and deployed.
- At runtime the XSLT service engine will load the files in the Jar as part of its execution thread context class-loader and will successfully execute the extension function.