Apply XSL transformations to one or more topics

You can use the Search and Replace feature to apply a different XSLT to one or more topics on the fly.

Prerequisites:

You must have created an XSL file for the XSLT you wish to apply.

XML stylesheet language transformations (XSLTs) use XML language to transform XML documents into HTML or some other format. XSLTs are carried out through XML stylesheet language (XSL) templates. Normally XSLTs are applied by the Output Generator when a map is generated. However, users can also choose to apply XSLTs to one or more specific topics on the fly, as described below. For example, a user might select a set of topics and transform them into HTML to add them to a PowerPoint presentation.

To apply XSLTs to one or more topics:

  1. Open the DITA perspective.
  2. Open the DITA Map view.
  3. Select the topics to which the XSLT will be applied and lock them.
  4. Click the Menu button Down arrow and select Search and Replace.
    Note: Alternatively, you can perform this action from the Search Results view, using the Search and Replace button: Search and replace in results list
    The Search and Replace window appears.
  5. Click the Apply XSLT tab.
    The Apply XSLT window appears.
  6. In the Applies to area, select your search scope (All or Selection).
  7. Click the Browse button and then locate the XSL file to use:

    Figure: Choosing an XSL



  8. Click Open.
    The XSL document name and path are added to the Apply XSLT window. If there are any variable parameters defined in the XSL, they will appear in the Name column of the Parameters list.

    Figure: Apply XSLT dialog box



  9. Under Parameters, enter the required Value for defined parameters (if any).
    Parameter values will be written into the XSL and applied during the transformation.
  10. Click Apply.
    The XSL template is applied to the selected topics.