Defining a new transformation scenario

The Configure Scenario dialog is used to associate a scenario from the list of all scenarios with the edited document by selecting an entry from the list. The dialog is opened by pressing the Configure Transformation Scenario button on the toolbar of the document view. Once selected the scenario will be applied with only one click on the Apply Transformation button on the same toolbar. Pressing the Apply Transformation button before associating a scenario with the edited document will invoke first the Configure Scenario dialog and then apply the selected scenario.

Open the Configure Transformation dialog by selecting Document+ XML Document->Configure transformation scenario. (Ctrl+Shift+C) Complete the dialog as follows:

 

Figure 5.1. The Configure Transformation Dialog - XSLT Tab

The Configure Transformation Dialog - XSLT Tab
XSL URL

Specifies an input XSL file to be used for the transformation.

Insert macros button

Opens a dialog allowing to introduce special <oXygen/> macros in the XSL URL field.

Button Browse for local input XSL file

Opens a file browser dialog allowing to select a local file name for the XSL URL field.

Button Browse for remote input XSL file

Opens a file browser dialog allowing to select a remote file name for the XSL URL field.

Button Open XSL file

Opens the file with the path specified in the XSL URL path in a new editor panel.

Checkbox Use "xml-stylesheet" declaration

Use the stylesheet declared with an "xml-stylesheet" declaration instead of the stylesheet specified in the XSL URL field.

Combo box Transformer

This combo box contains all the transformer engines available for applying the stylesheet. If you want to change the default selected engine just select other engine from the drop down list of the combo box.

Button Parameters

Opens the dialog for configuring the XSLT parameters.

Button Append header and footer

Opens a dialog for specifying a URL for a header HTML file added at the beginning of the result of an HTML transformation and a URL for a footer HTML file added at the end of the HTML result.

Button Additional XSLT stylesheets

Opens the dialog for adding XSLT stylesheets which are applied on the result of the main stylesheet specified in the XSL URL field.

Button Extensions

Opens the dialog for configuring the XSLT/XQuery extension jars or classes which define extension functions called from the XSLT/XQuery transformation.

 

Figure 5.2. The Configure Transformation Dialog - FO Processor Tab

The Configure Transformation Dialog - FO Processor Tab
Checkbox Perform FO Processing

Enable or disable the use of FOP during the transformation.

Radio button XSLT result as input

The FO processor is applied to the result of applying the XSLT stylesheet.

Radio button Edited document as input

The FO processor is applied directly to the current edited document.

Combo box Method

The output format of the FO processing: PDF, PostScript or plain text.

Combo box Processor

The FO processor, which can be the built-in Apache FOP processor or an external processor.

 

Figure 5.3. The Configure Transformation Dialog - Output Tab

The Configure Transformation Dialog - Output Tab
Radio button Prompt for file

At the end of the transformation it will be displayed a file browser dialog for specifying the path and name of the file which will store the transformation result.

Text field Save As

The path of the file where it will be stored the transformation result. The path can include special <oXygen/> macros.

Check box Open in browser

If this is checked <oXygen/> will open automatically the transformation result in a browser application specific for the type of that result (HTML/XHTML, PDF, text).

Radio button Saved file

When Open in browser is selected this button can be selected to specify that <oXygen/> should open the file specified in the Save As text field.

Radio button Other location

When Open in browser is selected this button can be used to specify that <oXygen/> should not open the file specified in the Save As text field, it should open the file specified in the text field of the Other location radio button. The file path can include special <oXygen/> macros.

Check box Show As XHTML

It is enabled only when Open in browser is disabled and if this is checked <oXygen/> will display the transformation result in a built-in XHTML browser panel of the <oXygen/> window.

[Important]Important

When transforming very large documents you should be aware that enabling this feature will result in a very long transformation time. This drawback appears due to the Java XHTML browser implementation. In this situations if you wish to see the result of the transformation you should use an external browser.

Check box Show As XML

If this is checked <oXygen/> will display the transformation result in an XML viewer panel with syntax highlight specific for XML documents.

Check box Show As SVG

If this is checked <oXygen/> will display the transformation result in a SVG viewer panel by rendering the result as a SVG image.

Text field Image URLs are relative to

If Show As XHTML is checked this text field specifies the path for resolving image paths contained in the transformation result.

 XSLT Stylesheet Parameters

The parameters of the XSLT stylesheet used in the transformation scenario are configured from the dialog available from the Parameters button:

 

Figure 5.4. Configure parameters dialog

Configure parameters dialog

The table presents all the parameters of the XSLT stylesheet and all imported and included stylesheets with their current values. If a parameter value was not edited then the table presents its default value. The bottom panel presents the default value of the parameter selected in the table and the system ID of the stylesheet that declares it.

For setting the value of a parameter declared in the stylesheet in a namespace, for example:

<xsl:param name="p:param" xmlns:p="namespace">default</xsl:param>

use the following expression in the Name column of the Parameters dialog:

{namespace}param

Use the following procedure to create a scenario.

 
  1. Select Document+ XML Document->Configure transformation scenario (Ctrl+Shift+C) to open the Configure Transformation dialog.

  2. Click the Duplicate Scenario button of the dialog to create a copy of the current scenario.

  3. Click in the Name field and type a new name.

  4. Click OK or Transform Now to save the scenario.