Defining Java Functions in the XSLT Mapper

You can write your own Java functions and use them when you map nodes.

To define your own functions:
1. Ensure that a Java virtual machine is running locally.
2. Create the class file for your function. See About Adding Java Class Files for more help with this step.
3. Display the Mapper tab in the XSLT editor, if necessary.
4. Right-click the mapper canvas.
5. In the pop-up menu that appears, select Java Functions > Register Java Extension Class.
6. In the Java Class Browser dialog box that appears, navigate to and select the Java class that provides your function.
7. Click OK in the Java Class Browser dialog box.

Now when you select Java Functions from the mapper short-cut menu, the list of functions includes the function you registered.

About Adding Java Class Files

The class file must be in your CLASSPATH environment variable or in the Stylus Studio ClassPath. To add it to the Stylus Studio ClassPath, select Tools > Options from the Stylus Studio menu bar. In the Options dialog box, expand Application Settings and click Java Virtual Machine.

 
Free Stylus Studio XML Training:
W3C Member