Author Default Operations

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: