Creating Debug configurations to transform and debug your files

Debug configurations enable you to provide details about the transformation and debugging of your files, such as the JRE you want to use, and the type of launch configuration you want to have. You can also save Debug configurations so you can reuse them.

Before you begin

About this task

To create a Debug configuration, follow these steps:

Procedure

  1. Switch to the Java™ perspective. Click Window > Open Perspective > Other > Java.
  2. Click Run > Debug. The Debug configuration dialog opens.
  3. Right-click XSL Transformation, and click New. A new, empty configuration is created.
  4. Select the new configuration.
  5. In the Main page, specify the following
    1. Name. Specify the name of your new Debug configuration.
    2. Project. Specify the project you want your source files to come from.
    3. Source XSL file. Specify your source XSL file.
    4. Source XML file. Specify any source file that contains XML. You cannot specify more than one source file as you can only debug one file at a time.
    5. Output file. Specify the name and location of your output file. If you select an existing file, its contents will be overwritten.
    6. The Stop in first template rule check box is selected by default. With this selected, the transformation process will stop at the first template defined in the XSL file.
  6. Click the Parameters tab. In the Parameters page, you can specify:
    1. Stylesheet Parameters. In your XSL stylesheet, you can define an xsl:param element with a Name attribute. You can use this page to specify a new Value for your parameter or override the existing one. To do so, click Add, then specify the Name of the attribute you want to override and the new or overriding Value.
    2. Output Properties. You can select to override the default output properties specified in your XSL style sheet file. For example, in your stylesheet file, you may have specified the output to be an HTML file and the encoding to be UTF-8, but you have decided that you want the output for this transformation to be a text file encoded in ASCII. To change these values, select the Override default setting check boxes and specify your new values. For more information about these fields, click F1.
    3. Transform Properties. If desired, specify the Recursion limit and URI base values. The Recursion limit specifies how many levels you want the transformation to link to and the URI base is a context path you can set so Uniform Resource Identifiers (URIs) will resolve properly.
  7. Click the JRE tab. This page defines the Java runtime environmental (JRE) used to run and debug the application. You should select a JRE that provides the appropriate Xalan and Xerces support you require.
    1. Select the Workspace default JRE radio button if you want to use the default workspace JRE.
    2. Otherwise, select the Alternate JRE radio button if you want to select from a list of already defined JREs. Click Installed JREs if you want to add another JRE to your list of options.
      Note: If you select an Alternate JRE, you will also have to specify the Java executable you want to use with the JRE you select.
  8. Click the Classpath tab. The Classpath page defines the location of class files used when running and debugging the application. By default, the user and bootstrap class locations are derived from the associated project's build path. You can override these settings here.
  9. Click the Source tab. This page defines the location of source files used to display source when debugging files. By default, these settings are derived from the associated project's build path. You can override these settings here.
  10. Click the Common tab. This page contains the following options:
    1. Type of launch configuration:Local or Shared. A launch configuration defines how a program should be launched. If you select Shared, you must specify the location of the shared configuration.
    2. You can select to display your Debug configuration in either the Debug or Run favorites menu, or both.
    3. The Launch in background check box determines whether the configuration will be launched in the background or not when it is run.
  11. Click Apply to save your changes to the configuration.
  12. Click Debug to run the transformation.

Results

The output file is created in the location you specified. If you selected an existing file as your output file, its contents will be overwritten.
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.

If you want to rerun the transformation and debugging at any time, you can open the Debug configuration dialog again (Run > Debug), select the configuration, and click Debug.


Feedback