Generating compiled XSL

To increase the speed of runtime processing of XSL stylesheets, you can precompile and integrate XSL 1.0 or 2.0 stylesheet documents into Java projects.

Before you begin

About this task

The following instructions were written for the Resource perspective, but they will also work in many other perspectives.

To generate a compiled XSL file from an XSL file:

Procedure

  1. In the Project Explorer, right-click the XSL file.
  2. Click Generate > Compiled XSL. The Compile XSLT wizard starts.
  3. Set the XSLT compiler options for generating the compiled XSL:
    1. Select the processor by choosing IBM Processor for XSLT 1.0 or IBM Processor for XSLT 2.0 from the list. If the target project for the compiled XSL output does not support the processor that you selected, you can add support by clicking Add processor support to target project.
    2. In the corresponding fields, enter the Class name, Package name and Output container for the generated compiled XSL classes.
  4. To add the output folder to the .classpath file of a project, select Include project container in project classspath, and then, in the Target Project field, enter the path project.
  5. To add a utility Java class containing methods you can use to invoke document transformation with the compiled XSL classes, select Add Java Utility Class, and then in the corresponding fields, enter the Source folder, Package and Name of the utility class.

Results

The compiled class and Java files are generated into the locations that you specified in the wizard.

Feedback