Configuring Transformation Scenarios

When distributing a framework to the users, it is a good idea to have the transformation scenarios already configured. This would help the content authors publish their work in different formats. Being contained in the Document Type Association the scenarios can be distributed along with the actions, menus, toolbars, catalogs, etc.

These are the steps that allow you to create a transformation scenario for your framework.

  1. Create a xsl folder inside the frameworks / sdf folder.

    The folder structure for the documentation framework should be:

    oxygen
      frameworks
         sdf
           schema
           css
           templates
           xsl
  2. Create the sdf.xsl file in the xsl folder. The complete content of the sdf.xsl file is found in the Example Files Listings.
  3. Open the Options/Preferences/Document Type Associations. Open the Document Type dialog for the SDF framework then choose the Transformation tab. Click the New button. In the Edit Scenario dialog, fill the following fields:
    • Fill in the Name field with SDF to HTML. This will be the name of your transformation scenario.
    • Set the XSL URL field to ${frameworks}/sdf/xsl/sdf.xsl.
    • Set the Transformer to Saxon 9B.
    Configuring a transformation scenario
  4. Change to the Output tab. Configure the fields as follows:
    • Set the Save as field to ${cfd}/${cfn}.html. This means the transformation output file will have the name of the XML file and the html extension and will be stored in the same folder.
    • Enable the Open in browser option.
    • Enable the Saved file option.

Now the scenario is listed in the Transformation tab:

The transformation tab

To test the transformation scenario you just created, open the SDF XML sample from the Example Files Listings. Click on the Apply Transformation Scenario button to display the Configure Transformation Dialog. Its scenario list contains the scenario you defined earlier SDF to HTML. Click it then choose Transform now. The HTML file should be saved in the same folder as the XML file and displayed in the browser.

Selecting the predefined scenario