Editor Variables

An editor variable is a shorthand notation for context-dependent information, such as a file
or folder path, a time-stamp, or a date. It is used in the definition of a command (for
example, the input URL of a transformation, the output file path of a transformation, or the
command line of an external tool) to make a command or a parameter generic and re-usable with
other input files. When the same command is applied to multiple files, the notation is
expanded at the execution of the command so that the same command has different effects
depending on the actual file.

You can use the following editor variables in Oxygen XML Editor commands of external
engines or other external tools, and in various places in the application, such as in
transformation scenarios, Author mode
operations, and validation scenarios:

${activeConditionSet} - Current active profiling condition set name. If there is no
active condition set, the variable will be replaced with an empty string.

${af} - The local file path of the ZIP archive that includes the
current edited document.

${afd} - The local directory path of the ZIP archive that includes
the current edited document.

${afdu} - The URL path of the directory of the ZIP archive that
includes the current edited document.

${afn} - The file name (without parent directory and without file
extension) of the zip archive that includes the current edited file.

${afne} - The file name (with file extension, for example
.zip or .epub, but without parent directory) of
the zip archive that includes the current edited file.

${afu} - The URL path of the ZIP archive that includes the current
edited document.

${answer(@id)} - Used in conjunction with the ${ask}
editor variable. The @id parameter is required and identifies the answer from the
${ask} editor variable with the same id.

${ask('message', type, ('real_value1':'rendered_value1';
'real_value2':'rendered_value2'; ...), 'default_value'), @id} - To prompt for values
at runtime, use the ask('message', type, ('real_value1':'rendered_value1';
'real_value2':'rendered_value2'; ...), 'default-value'') editor variable. You can set
the following parameters:

'message' - The displayed message. Note the quotes that enclose the
message.

'default-value' - Optional parameter. Provides a default value.

@id - Optional parameter. Used for identifying the variable to reuse the answer
using the ${answer(@id)} editor variable.

type - Optional parameter, with one of the following values:

Note: The title of
the dialog box will be determined by the type of parameter and as follows:

For url and relative_url parameters, the title will be the name of
the parameter and the value of the 'message'.

For the other parameters listed below, the title will be the name of that
respective parameter.

If no parameter is used, the title will be "Input".

Parameter

url

Format:${ask('message', url, 'default_value')}

Description: Input is considered a URL. Oxygen XML Editor
checks that the provided URL is valid.

Example:

${ask('Input URL', url)} - The displayed dialog box has the name
Input URL. The expected input type is URL.

${ask('Input URL', url, 'http://www.example.com')} - The
displayed dialog box has the name Input URL. The expected input
type is URL. The input field displays the default value
http://www.example.com.

password

Format: ${ask('message', password, 'default')}

Description: The input is hidden with bullet characters.

Example:

${ask('Input password', password)} - The displayed dialog box has
the name 'Input password' and the input is hidden with bullet
symbols.

${ask('Input password', password, 'abcd')} - The displayed dialog
box has the name 'Input password' and the input hidden with bullet
symbols. The input field already contains the default abcd value.

generic

Format: ${ask('message', generic, 'default')}

Description: The input is considered to be generic text that
requires no special handling.

${ask('Hello world!', generic, 'Hello again!')} - The dialog box
has a Hello world! message displayed and the value displayed in the
input box is 'Hello again!'.

relative_url

Format:${ask('message', relative_url, 'default')}

Description: Input is considered a URL. Oxygen XML Editor
tries to make the URL relative to that of the document you are
editing.

Note: If the $ask editor variable is expanded in content that
is not yet saved (such as an untitled file, whose path cannot be
determined), then Oxygen XML Editor will transform it into an absolute
URL.

Example:

${ask('File location', relative_url, 'C:/example.txt')} - The
dialog box has the name 'File location'. The URL inserted in the
input box is made relative to the current edited document location.

Description: Displays a dialog box that offers a drop-down menu.
The drop-down menu is populated with the given rendered_value values.
Choosing such a value will return its associated value
(real_value).

Note: The 'default' parameter specifies the
default selected value and can match either a key or a value.

Example:

${ask('Operating System', combobox, ('win':'Microsoft
Windows';'osx':'Mac OS X';'lnx':'Linux/UNIX'), 'osx')} - The
dialog box has the name 'Operating System'. The drop-down menu
displays the three given operating systems. The associated value will be
returned based upon your selection.

Note: In this example, the default
value is indicated by the osx key. However, the same result
could be obtained if the default value is indicated by Mac OS
X, as in the following example: ${ask('Operating System',
combobox, ('win':'Microsoft Windows';'osx':'Mac OS
X';'lnx':'Linux/UNIX'), 'Mac OS X')}

Description: Displays a dialog box that offers a drop-down menu
with editable elements. The drop-down menu is populated with the given
rendered_value values. Choosing such a value will return its
associated real value (real_value) or the value inserted when you edit
a list entry.

Note: The 'default' parameter specifies the default
selected value and can match either a key or a value.

Example:

${ask('Operating System', editable_combobox, ('win':'Microsoft
Windows';'osx':'Mac OS X';'lnx':'Linux/UNIX'), 'osx')} - The
dialog box has the name 'Operating System'. The drop-down menu
displays the three given operating systems and also allows you to edit
the entry. The associated value will be returned based upon your
selection or the text you input.

Description: Displays a dialog box that offers a series of radio
buttons. Each radio button displays a 'rendered_value and will return
an associated real_value.

Note: The 'default' parameter specifies
the default selected value and can match either a key or a
value.

Example:

${ask('Operating System', radio, ('win':'Microsoft
Windows';'osx':'Mac OS X';'lnx':'Linux/UNIX'), 'osx')} - The dialog
box has the name 'Operating System'. The radio button group allows
you to choose between the three operating systems.

Note: In this example
Mac OS X is the default selected value and if
selected it would return osx for the output.

${dbgXML} - The local file path to the XML document that is
current selected in the Debugger source combo box (for tools started from the XSLT/XQuery
Debugger).

${dbgXSL} - The local file path to the XSL/XQuery document that
is current selected in the Debugger stylesheet combo box (for tools started from the
XSLT/XQuery Debugger).

${dita.dir.url} - A special local contextual editor variable that
gets expanded only in the Libraries dialog box that is accessible
from the Advanced tab of DITA transformation scenarios. The
Libraries dialog box allows you to specify additional libraries
(JAR files or additional class paths) to
be used by the transformer. This ${dita.dir.url} editor variable gets expanded to the
value of the dita.dir parameter from the Parameters tab of the
DITA transformation scenario.

${ds} - The path of the detected schema as a local file path for the
current validated XML document.

${dsu} - The path of the detected schema as a URL for the current
validated XML document.

${env(VAR_NAME)} - Value of the VAR_NAME environment
variable. The environment variables are managed by the operating system. If you are looking
for Java System Properties, use the ${system(var.name)} editor variable.

${framework(fr_name)} - The path (as URL) of the
fr_nameframework.

${framework} - The path (as URL) of the current
framework directory.

${frameworkDir(fr_name)} - The path (as file path)
of the fr_nameframework.

Note: Since multiple frameworks might have the same name
(although it is not recommended), for both ${framework(fr_name)} and
${frameworkDir(fr_name)} editor variables Oxygen XML Editor employs the
following algorithm when searching for a given framework name:

${i18n(key)} - Editor variable used only at
framework-level to allow translating names and descriptions of
Author mode actions in multiple actions. For more details, see Localizing Frameworks.

${id} - Application-level unique identifier. It is a short sequence
of 10-12 letters and digits that is not guaranteed to be universally unique.

${makeRelative(base,location)} - Takes two URL-like paths as
parameters and tries to return a relative path. A use-case would be to insert content
references to a certain reusable component when defining code
templates.

${pd} - The file path to the folder that contains the current project
file (.xpr).

${pdu} - The URL path to the folder that contains the current
project file (.xpr).

${pluginDir(pluginID)} - Each plugin has an ID specified in
its plugin.xml file. This editor variable expands to the file path of
the folder that contains the plugin.xml file where that specific plugin
ID is located.

${pluginDirURL(pluginID)} - Each plugin has an ID specified
in its plugin.xml file. This editor variable expands to the URL path of
the folder that contains the plugin.xml file where that specific plugin
ID is located.

${pn} - Current project name.

${ps} - Path separator, which is the separator that can be used on
the current platform (Windows, OS X, Linux) between library files specified in the class
path.

${rootMapDir} - Will be expanded to the current root map parent
directory file path.

${rootMapDirURL} - Will be expanded to the current root map
parent directory URL.

${rootMapFile} - Will be expanded to the current root map file
path.

${rootMapURL} - Will be expanded to the current root map
URL.

${selection} - The current selected text content in the
current edited document. This variable can be used in a code template, in
Author mode operations, or in a selectionplugin.

${system(var.name)} - Value of the
var.name Java System Property. The Java system properties can be specified in the
command line arguments of the Java runtime as -Dvar.name=var.value. If you are
looking for operating system environment variables, use the ${env(VAR_NAME)} editor
variable instead.

${timeStamp} - Time stamp, that is the current time in Unix
format. For example, it can be used to save transformation results in multiple output files
on each transformation.

${tp} - Total number of pages in the document. Used to display the
total number of pages on each printed page in the Editor / Print Preferences
page.

${tsf} - The transformation result file path. If the current opened
file has an associated scenario that specifies a transformation output file, this variable
expands to it.

${xmlCatalogFilesList} - A list of file paths that point
to all known XML catalog files, separated by semi-colons (;).

${xpath_eval(expression)} - Evaluates an XPath 3.0 expression.
Depending on the context, the expression can be:

static - When executed in a non-XML context. For example, you can use such
static expressions to perform string operations on other editor variables for composing
the name of the output file in a transformation scenario's Output
tab.

Example:

${xpath_eval(upper-case(substring('${cfn}', 1, 4)))}

dynamic - When executed in an XML context. For example, you can use such
dynamic expression in a code template or as a value of a parameter of an
Author mode operation.