Editing XSL files

To open an XSL file in the XSL editor, double-click it in the Navigator view, or right-click it and click Open With > XSL Editor.

Once you have created an XSL file, you can edit it in the XSL editor. You can also import XSL files you have created outside this product into the workbench and edit them in the XSL editor.

You can edit XSL files in the following ways:

Editing XSL files manually

You can edit your XSL files manually, changing the code as necessary. You can use content assist (select Ctrl + Space to invoke it) to help you edit the XSL file. When you invoke content assist, a list of available options for your XSL file will appear. Double-click the option you want to insert in the XSL file.

Editing your XSL files using XSL editor wizards

You can use several XSL editor wizards to edit your XSL file. All the XSL editor wizards can be accessed from the XSL drawer in the Snippets view :

When you have finished editing your file, you can validate it. For more information on using these wizards and validating your file, refer to the related tasks below.

Setting breakpoints in your XSL file

To set a breakpoint in an XSL file, place the cursor in the line where you want the breakpoint to be, and click Toggle Breakpoints from the pop-up menu. To remove it, select it and click Toggle Breakpoints again from the pop-up menu.

XSL editor
An XSL file is a style sheet that can be used to transform XML documents into other document types and to format the output.

Adding an <xsl:apply-templates> element to your XSL file
You can add an <xsl:apply-templates> element to your XSL file using the Apply Template wizard. The <xsl: apply-templates> element recursively processes all the children of the source element if a select attribute is not specified. If a select attribute is specified, it will process nodes selected by the select attribute expression instead of processing all the children.

Adding an <xsl:call-template> element to your XSL file
You can add an <xsl:call-template> element to your XSL file using the Call Template wizard. The <xsl: call-template> element is used for invoking a template by its name.

Adding an <xsl:choose> element to your XSL file
You can use the XSL Conditional Processing wizard to create <xsl: choose> elements for XSL files. The <xsl: choose> element enables you to select an option from a sequence of alternatives.

Adding an <xsl:template> element to your XSL file
You can add an <xsl:template> element to your XSL file using the XSL Template wizard. <xsl: template> elements are the most important elements in XSLT. They are the basis for matching routines to perform a transformation.

Adding an <xsl:output> element to your XSL file
You can add an <xsl:output> element to your XSL file using the XSL Output wizard. The <xsl: output> element is used to specify the output you will be using (for example, HTML) and provides you with a way of controlling how the output is created.

Adding an HTML header to your XSL file
Sometimes, you may want to produce an HTML file using your XSL file. You can easily create a template that contains the <html> header together with the appropriate <xsl:output> element.

Adding an HTML form to your XSL file
You can add an HTML form to your XSL file using the XSL Form wizard. You will base this form on an existing XML file.

Adding an HTML table to your XSL file
You can add an HTML table to your XSL file using the XSL Table wizard. You will base this table on an existing XML file.

Icons used in the XSL editor
The following XSL editor icons appear in the Outline view.