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.

In the following section we will create a transformation scenario for our framework.

Create the directory xsl in the directory frameworks/sdf. The directory structure for our documentation framework should be:

oxygen
  frameworks
     sdf
       schema
       css
       templates
       xsl

Create the sdf.xsl file in the xsl directory. The complete content of the sdf.xsl file is found in the Example Files Listings.

Open the Options/Preferences/Document Type Associations. Open the Document Type dialog for the SDF framework then choose the Transformation tab. Click on the New. In the Edit Scenario dialog, fill the following fields:

Name

The name of the transformation scenario. Enter SDF to HTML.

XSL URL

${frameworks}/sdf/xsl/sdf.xsl

Transformer

Saxon 9B.

Change to the Output tab. Change the fields:

Save as

${cfd}/${cfn}.html This means the transformation output file will have the name of the XML file and the html extension and will be placed in the same directory.

Open in browser

Enable this option.

Saved file

Enable this checkbox.

Figure 7.33. Configuring a transformation scenario

Configuring a transformation scenario

Now the scenario is listed in the Transformation tab:

Figure 7.34. The transformation tab

The transformation tab

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

Figure 7.35. Selecting the predefined scenario

Selecting the predefined scenario

Note

The key symbol indicates that the scenario is read-only. It has this state because the scenario was loaded from a Document Type Association. The content authors can still change parameters and other settings if they are duplicating the scenario and edit the duplicate. In this case the copy of the scenario is created in the user local settings.