Creating XSL files

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

Since the XML language does not use predefined tags, it is necessary to provide the Web browser with information on how to interpret the XML document. The XSL document provides the browser with information on how to display an XML document.

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

  1. Create a project to contain the XSL file.

  2. In the workbench, click File > New > Other > XML > XSL and click Next.

  3. Select the project or folder that will contain the XSL file.

  4. In the File name field, type the name of the XSL file, for example MyXSLFile.xsl. The name of your XSL file must end with the extension .xsl.

  5. Click Next, or, if you do not want to associate an XML file with your XSL file, click Finish.

  6. You can select an XML file to associate with your XSL file. For more information about associating XSL files with XML files, refer to the related tasks.

  7. Click Finish.

The XSL file appears in the Navigator view and automatically opens in the XSL editor.

Selecting xsl:stylesheet or xsl:transform as your root element
You can have either xsl:stylesheet or xsl:transform as the root element of your XSL style sheet. The root element defines the namespace used by the XSL style sheet and the version of XSL being used in the document.

 

Related tasks

Associating XSL files with XML files