Below are listed all the operations and their arguments.
- InsertFragmentOperation
-
Inserts an XML fragment at the current cursor position. The selection - if there is
one, remains unchanged. The fragment will be inserted in the current context of the
cursor position meaning that if the current XML document uses some namespace
declarations then the inserted fragment must use the same declarations. The inserted
fragment will not be copied and pasted to the cursor position, but the namespace
declarations of the fragment will be adapted if needed to the existing namespace
declarations of the XML document.
- InsertOrReplaceFragmentOperation
-
Similar to InsertFragmentOperation, except it removes the selected
content before inserting the fragment.
- InsertOrReplaceTextOperation
-
Inserts a text at current position removing the selected content, if any.
- text
-
The text section to insert.
- SurroundWithFragmentOperation
-
Surrounds the selected content with a text fragment. Since the fragment can have
multiple nodes, the surrounded content will be always placed in the first leaf element.
If there is no selection, the operation will simply insert the fragment at the caret
position.
- SurroundWithTextOperation
-
This operation has two arguments (two text values) that will be inserted before and
after the selected content. If there is no selected content, the two sections will be
inserted at the caret position. The arguments of the operation are:
- header
-
The text that will be placed before the selection.
- footer
-
The text that will be placed after the selection.
- InsertEquationOperation
-
Inserts a fragment containing a MathML equation at caret offset. The operation argument
is:
- fragment
-
The XML fragment containing the MathML content which should be inserted
- InsertXIncludeOperation
-
Insert an XInclude element at caret offset.
- ChangeAttributeOperation
-
This operation allows adding/modifying/removing an attribute. You can use this
operation in your own Author action to modify the value for a certain attribute on a
specific XML element. The arguments of the operation are:
- name
-
The attribute local name.
- namespace
-
The attribute namespace.
- elementLocation
-
The XPath location that identifies the element.
- value
-
The new value for the attribute. If empty or null the attribute will be
removed.
- UnwrapTagsOperation
-
This operation allows removing the element tags either from the current element or for
an element identified with an XPath location. The argument of the operation is:
- unwrapElementLocation
-
An XPath expression indicating the element to unwrap. If it is not defined, then
the element at caret is unwrapped.
- ToggleSurroundWithElementOperation
-
This operation allows wrapping and unwrapping content in a specific element with
specific attributes. Useful to implement toggle actions like highlighting text as bold,
italic, or underline. The arguments of the operation are:
- element
-
The element to wrap content (or unwrap).
- schemaAware
-
This argument applies only on the surround with element operation and controls if
the insertion is schema aware or not.
Author operations
can take parameters that might contain the following editor variables:
- ${caret} - The position where the caret is
inserted. This variable can be used in a code template
, in Author
operations, or in a
selection plugin.
- ${selection} - The XML content of the current
selection in the editor panel. This variable can be used in a code template
and Author
operations,
- ${ask('user-message', param-type, 'default-value'
?)} - To prompt for values at runtime, use the ask('user-message',
param-type, 'default-value' ?) editor variable. The following parameters can be set:
- 'user-message' - the actual message to be displayed. Note the quotes
that enclose the message.
- param-type - optional parameter. Can have one of the following values:
- url - input is considered to be an URL.
Oxygen XML Editor plugin
checks
that the URL is valid before passing it to the transformation.
- password - input characters are hidden.
- generic - the input is treated as generic text that requires no
special handling.
- 'default-value' - optional parameter. Provides a default value in the
input text box.
Examples:
- ${ask('message')} - Only the message displayed for the user is
specified.
- ${ask('message', generic, 'default')} -
'message' will be displayed for the user, the type is not
specified (the default is string), the default value will be
'default'.
- ${ask('message', password)} - 'message' will
be displayed for the user, the characters typed will be replaced with a circle
character.
- ${ask('message', password, 'default')} - Same as above, default
value will be 'default'.
- ${ask('message', url)} - 'message' will be
displayed for the user, the type of parameter will be URL.
- ${ask('message', url, 'default')} - Same as above, default
value will be 'default'.
- ${timeStamp} - Time stamp, that is the current
time in Unix format. It can be used for example to save transformation results in different
output files on each transform.
- ${uuid} - Universally unique identifier.
- ${id} - Application-level unique identifier.
- ${cfn} - Current file name without extension and
without parent folder.
- ${cfne} - Current file name with extension.
- ${cf} - Current file as file path, that is the
absolute file path of the current edited document.
- ${cfd} - Current file folder as file path, that is
the path of the current edited document up to the name of the parent folder.
- ${frameworksDir} - The path (as file path)
of the frameworks subfolder of the
Oxygen XML Editor plugin
installation folder.
- ${pd} - Current project folder as file path.
- ${oxygenInstallDir} -
Oxygen XML Editor plugin
installation folder as
file path.
- ${homeDir} - The path (as file path) of the user
home folder.
- ${pn} - Current project name.
- ${env(VAR_NAME)} - Value of the
VAR_NAME environment variable.
- ${system(var.name)} - Value of the
var.name system variable.
- ${date(pattern)} - Current date. Follows the given
pattern. Example: yyyy-MM-dd.