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 and deployed to the Glassfish application server.
- 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 call.
For more detail on what you can do with this feature, see the Xalan-Java Extensions page
. The syntax in this example is described in the section on abbreviated syntax for Java extensions
. You may also be interested in the type mappings between Java and XSLT
.
This page (revision-9) was last changed on
13-Feb-09 12:31 PM, -0800
by BobPollack.
This page was created on
09-Apr-08 17:59 PM, -0700 by Philip Varghese.
More info...