Quickly transforming and debugging files using XSL style sheets

You can apply an XSL file to any file that contains XML content (generally an XML file or an XML schema file) to generate a new HTML, XML, or text output file. You can also select to open your input files in the Debug perspective after the transformation has been run in order to debug them.

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 quickly run an XSL transformation on any file that contains XML content, follow these instructions:

Procedure

  1. In the Navigator view, select your XSL file and the file you wish to transform.
  2. Right-click them and, from the pop-up menu, click Debug > XSL Transformation.

Results

The Console view lists the XSL and input file names, and the name of the output file, which will be named as follows:

If the Console view is not already open, you can open it by clicking Window > Show View > Other > Basic > Console.

The type of output file created is determined by the contents of the <xsl: output> element in your XSL file. Normally, in your <xsl: output> element, you would specify the output method to be XML, HTML, or text.

Your output file will be saved to the same location your XML file is located.
Note: Your output file will not appear in the Navigator view until you refresh the contents of the folder or project that contains it.

What to do next

After the transformation has been completed, you will be prompted to switch to the Debug perspective. Click Yes. You can use the Java™ debugger to debug your files. Refer to the Java Development tools (JDT) debugger and Java Development User Guide online documentation for more information about working in the Debug perspective and using the Java debugger.

Feedback