Edit online

Oxygen XML Web Author Editor Variables

The Oxygen XML Web Author processes most Oxygen XML Editor/Author editor variables. The supported editor variables include:
  • ${ask('message', type, ('real_value1':'rendered_value1'; 'real_value2':'rendered_value2'; ...), 'default_value')} - 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.
    • 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 Web Author 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.
      Example:
      • ${ask('Hello world!')} - The dialog box has a Hello world! message displayed.
      • ${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 Web Author 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 Web Author 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 currently edited document location.

      combobox Format: ${ask('message', combobox, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')}
      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';'macos':'macOS';'lnx':'Linux/UNIX'), 'macos')} - 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, as in the following example: ${ask('Operating System', combobox, ('win':'Microsoft Windows';'macos':'Mac OS';'lnx':'Linux/UNIX'), 'macOS')}
      • ${ask('Mobile OS', combobox, ('win':'Windows Mobile';'ios':'iOS';'and':'Android'), 'Android')}
      editable_combobox Format: ${ask('message', editable_combobox, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')}
      Description: Displays a dialog box that offers a drop-down menu with editable elements. The drop-down menu is populated with the given real_value type of values. Besides choosing one of the options, you can also write a custom value in the text field.
      Note: The 'default' parameter specifies the default-selected value and can match either a key or a value.
      Note: rendered_value type of values are ignored.
      Example:

      ${ask('Operating System', editable_combobox, ('win':'Microsoft Windows';'macos':'macOS';'lnx':'Linux/UNIX'), 'macos')} - 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.

      radio Format: ${ask('message', radio, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')}
      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';macos:'macOS';'lnx':'Linux/UNIX'), 'macos')} - 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, macOS is the default-selected value and if selected, it would return macos for the output.
  • ${caret} - The position where the cursor is located. This variable can be used in a code template, in Author mode operations, or in a selection plugin.
  • ${cf} - Current file as file path, that is the absolute file path of the currently edited document.
  • ${cfd} - Current file folder as file path, that is the path of the currently edited document up to the name of the parent folder.
  • ${cfdu} - Current file folder as URL, that is the path of the currently edited document up to the name of the parent folder, represented as a URL.
  • ${cfn} - Current file name without the extension and parent folder. The current file is the one currently open and selected.
  • ${cfne} - Current file name with extension. The current file is the one currently open and selected.
  • ${comma} - Used to display a comma when the actual comma symbol would be considered part of some sort of instruction or delimiter.
  • ${configured.ditaot.dir} - The default directory of the DITA Open Toolkit distribution.
  • ${currentFileURL} - Current file as URL, that is the absolute file path of the currently edited document represented as URL.
  • ${date(pattern)} - Current date. The allowed patterns are equivalent to the ones in the Java SimpleDateFormat class. Example: yyyy-MM-dd.
    Note: This editor variable supports both the xs:date and xs:datetime parameters. For details about xs:date, go to: http://www.w3.org/TR/xmlschema-2/#date. For details about xs:datetime, go to: http://www.w3.org/TR/xmlschema-2/#dateTime.
  • ${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_name framework.
  • ${framework} - The path (as URL) of the current framework directory.
  • ${frameworkDir(fr_name)} - The path (as file path) of the fr_name framework.
  • ${frameworkDir} - The path (as file path) of the current framework directory.
  • ${frameworks} - The path (as URL) of the frameworks directory. When used to define references inside a framework configuration, it expands to the parent folder of that specific framework folder. Otherwise, it expands to the main frameworks folder defined in the Document Type Association > Locations preferences page.
  • ${frameworksDir} - The path (as file path) of the frameworks directory. When used to define references inside a framework configuration, it expands to the parent folder of that specific framework folder. Otherwise, it expands to the main frameworks folder defined in the Document Type Association > Locations preferences page.
  • ${home} - The path (as URL) of the user home folder.
  • ${homeDir} - The path (as file path) of the user home folder.
  • ${i18n(key)} - Editor variable used only at framework-level to allow translating names and descriptions of Author mode actions in multiple actions.
  • ${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.

    Example:
    ${makeRelative(${currentFileURL}, ${dictionaryURL}#gogu)}
  • ${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.
  • ${ps} - Path separator, which is the separator that can be used on the current platform (Windows, macOS, Linux) between library files specified in the class path.
  • ${selection} - The currently selected text content in the currently edited document. This variable can be used in a code template, in Author mode operations, or in a selection plugin.
  • ${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} - The timestamp, which is the current time in Unix format. For example, it can be used to save transformation results in multiple output files on each transformation.
  • ${uuid} - Universally unique identifier, a unique sequence of 32 hexadecimal digits generated by the Java UUID class.
  • ${xmlCatalogFilesList} - A list of file paths that point to all known XML catalog files, separated by semi-colons (;).
  • ${xpath_eval(expression)} - Evaluates an XPath 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.

      Example:
      ${ask('Set new ID attribute', generic, '${xpath_eval(@id)}')}
  • ${user.name} - Evaluates to the name of the current user. Can be used only as an argument to com.oxygenxml.username.InsertFragmentOperation, which is contributed by this plugin: https://github.com/oxygenxml/web-author-sample-plugins/tree/master/user-name-insert-operation-plugin.
    Note: The ${author.name} editor variable is not supported in Oxygen XML Web Author.