Associating XSL files with XML files

You can associate an XSL file with an XML file. Associating an XSL file with an XML file provides the following benefits:

You can associate an XSL file with more than one XML file, with one of them set as the default (that is, the one that will automatically be used if you transform, debug, or add an XPath expression to the XSL file).

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

Follow these steps to associate an XML file with an XSL file:

  1. In the Navigator view, right-click the XSL file and click Properties, then select Associations. You can also open your XSL file in the XSL editor and click XSL > Associate XML.

  2. Click Add XML files. Select one or more XML files to associate with the XSL file, then click Finish.

  3. The new associations will be listed in the XML files field. Any previously created associations will also be listed in this field.

  4. If you no longer want an XML file to be associated with your XSL file, select it and click Remove.

  5. You can change the default XML file by selecting it in from the Default XML file list. This is the file that is automatically used if you add an XPath expression to the XSL file or use XSL wizards with it.

  6. Click OK.

 

Related tasks

Creating XSL files