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. For more details about the list of parameters go to The arguments of InsertFragmentOperation operation.
Similar to InsertFragmentOperation, except it removes the selected content before inserting the fragment.
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. For more details about the list of parameters go to The arguments of SurroundWithFragmentOperation.
Insert an XInclude element at caret offset.
Applies an XSLT or XQuery script on a source element and then replaces or inserts the result in a specified target element.
An XPath expression indicating the element that the script will be applied on. If it is not defined then the element at the caret position will be used.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xpath-default-namespace="http://docbook.org/ns/docbook" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="saxon"> <!-- This is an XPath location which will be sent by the operation to the script --> <xsl:param name="currentElementLocation"/> <xsl:template match="/"> <!-- Evaluate the XPath of the current element location --> <xsl:apply-templates select="saxon:eval(saxon:expression($currentElementLocation))"/> </xsl:template> <xsl:template match="para"> <!-- And the context is again inside the current element, but we can use information from the entire XML --> <xsl:variable name="keyImage" select="//imagedata[@fileref='images/lake.jpeg'] /ancestor::inlinemediaobject/@xml:id/string()"/> <xref linkend="{$keyImage}" role="key_include" xmlns="http://docbook.org/ns/docbook"> <xsl:value-of select="$currentElementLocation"></xsl:value-of> </xref> </xsl:template> </xsl:stylesheet>
An XPath expression indicating the insert location for the result of the transformation. If it is not defined then the insert location will be at the caret.
The script content (XSLT or XQuery). The base system ID for this will be the framework file, so any include/import reference will be resolved relative to the .framework file that contains this action definition.
For example, for the following script, the imported xslt_operation.xsl needs to be located in the current framework's directory.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="xslt_operation.xsl"/> </xsl:stylesheet>
The insert action relative to the node determined by the target XPath expression. It can be: Replace, At caret position, Before, After, Inside as first child or Inside as last child.
The position of the caret after the action is executed. It can be: Preserve, Before, Start, First editable position, End or After. If not specified the caret position ca be specified by outputting in the XSLT script a ${caret} editor variable.
Parameter controlling the expansion of editor variables returned by the script processing. Expansion is enabled by default.
Allows you to call the Java API from custom JavaScript content.
function doOperation(){
caretOffset = authorAccess.getEditorAccess().getCaretOffset();
currentNode = authorAccess.getDocumentController().getNodeAtOffset(caretOffset);
//Move caret after current node
authorAccess.getEditorAccess().setCaretPosition(currentNode.getEndOffset() + 1);
}
| 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:
|
|
| password | Format: ${ask('message', password, 'default')} |
| Description: The input is hidden with bullet characters. | |
Example:
|
|
| generic | Format: ${ask('message', generic, 'default')} |
| Description: The input is considered to be generic text that requires no special handling. | |
Example:
|
|
| 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:
|
|
| combobox | Format: ${ask('message', combobox, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')} |
| Description: Displays a dialog box that offers a drop-down list. The drop-down list is populated with the given rendered_value values. Choosing such a value will return its associated value (real_value). | |
Example:
|
|
| 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 list with editable elements. The drop-down list 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. | |
Example:
|
|
| 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. | |
Example:
|