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
Transformation 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 + → (Ctrl+Shift+C) Complete the dialog as follows:
- XML URL
Specifies an input XML file to be used for the transformation.
Please note that this URL is resolved through the catalog resolver.
If the catalog does not have a mapping for the URL, then the editor
will try to use the file directly.
The following buttons are shown immediately after the input
field:
- Insert editor variables button
Opens a pop-up menu allowing to introduce special
<oXygen/> editor
variables in the XML URL field.
- Button Browse for local input XSL
file
Opens a file browser dialog allowing to select a local
file name for the XML URL field.
- Button Browse for remote input XML
file
Opens a file browser dialog allowing to select a
remote file name for the XML URL field.
- Button Browse for archive file
Opens a zip archive browser dialog allowing to select
a file from a zip archive for the XML URL field.
- Button Open XML file
Opens the file with the path specified in the XML URL
path in a the editor.
- XSL URL
Specifies an input XSL file to be used for the transformation.
Please note that this URL is resolved through the catalog resolver.
If the catalog does not have a mapping for the URL, then the editor
will try to use the file directly.
The above set of browsing buttons are available also for this
input.
- Checkbox Use "xml-stylesheet" declaration
Use the stylesheet declared with an "xml-stylesheet" declaration
instead of the stylesheet specified in the XSL URL field. By default
this checkbox is not selected and the transformation applies the
XSLT stylesheet specified in the XSL URL field. If it is checked the
scenario applies the stylesheet specified explicitly in the XML
document with the xml-stylesheet processing instruction.
- Combo box Transformer
This combo box contains all the transformer engines available for
applying the stylesheet. These are the built-in engines and the external engines
defined in the user preferences. 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. In this dialog you set
any global XSLT parameters of the main stylesheet set in the
XSL URL field or of the additional
stylesheets set with the button Additional XSLT
stylesheets.
- 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 of the
transformation.
- 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. This is
useful when a chain of XSLT stylesheets must be applied to the input
XML document.
- Button Extensions
Opens the dialog for
configuring the XSLT/XQuery extension jars or classes
which define extension Java functions or extension XSLT elements
used in the XSLT/XQuery transformation.
When creating a scenario that applies to an XML file, <oXygen/> fills the XML URL
with the default variable "${currentFile}". This means the input for the
transformation is taken from the currently edited file. You can modify this
value to other file path. This is the case of currently editing a section from a
large document, and you want the transformation to be performed on the main
document, not the section. You can specify in this case either a full absolute
path: file:/c:/project/docbook/test.xml or a path relative to one of the editor
variables, like the current project file: ${pdu}/docbook/test.xml
.
When the scenario applies to XSL files, the field XSL URL is containing
${currentFile}. Just like in the XML case, you can specify here the path to a
master stylesheet. The path can be configured using the editor variables.
- Checkbox Perform FO Processing
Enable or disable applying an FO processor (either the built-in
Apache FOP engine or an external engine defined in Preferences)
during the transformation.
- Radio button XSLT result as input
The FO processor is applied to the result of the XSLT
transformation defined on the XSLT tab of the dialog.
- 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.
- Radio button Prompt for file
At the end of the transformation a file browser dialog will be
displayed 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/> editor variables.
- 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 automatically at
the end of the transformation 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/> editor
variables.
- Check box Open in editor
When this is checked the transformation result set in the
Save As field is opened in a new editor
panel in <oXygen/> with the appropriate built-in editor type: if the
result is an XML file it is opened with the built-in XML editor, if
it is an XSL-FO file it is opened with the built-in FO editor,
etc.
- Check box Show As XHTML
It is enabled only when Open in browser is
disabled. If this is checked <oXygen/> will display the transformation
result in a built-in XHTML browser panel at the bottom of the <oXygen/> window.
![[Important]](img/important.gif) | Important |
|---|
When transforming very large documents you should be aware
that enabling this feature will result in a very long time
necessary for rendering the transformation result in the
XHTML result viewer panel. This drawback appears due to the
built-in Java XHTML browser implementation. In this
situations if you wish to see the XHTML result of the
transformation you should use an external browser by
checking the Open in browser
checkbox. |
- Check box Show As XML
If this is checked <oXygen/> will display the transformation result in
an XML viewer panel at the bottom of the <oXygen/> window 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 at the bottom of the <oXygen/> window 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 global parameters of the XSLT stylesheet used in the transformation
scenario are configured from the dialog available from the
Parameters button:
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, a
description of the parameter if it is available 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}paramThe buttons of the dialog have the following functions:
- Add
Add a new parameter to the list.
- Edit
Edit the value of the selected parameter.
- Disable
Reset the selected parameter to the default value. This button
is enabled only for parameters with edited values, that is
values set in this dialog with the Edit
button.
- Remove
Remove the selected parameter from the list. It is enabled
only for parameters added to the list with the
Add button.
The editor variables displayed at the bottom of the dialog (${frameworks},
${home}, ${cfd}, etc) can be used in the values of the parameters to make
the value independent of the location of the XSLT stylesheet or the XML
document.
© 2008 syncRO soft ltd.