Oxygen XML Author Eclipse plugin includes some useful actions that allow you to easily edit XML markup
in Author mode. Most of these actions are available in the contextual
menu and some of them have simple keyboard shortcuts.
Selecting XML Markup in Author Mode
Selecting XML tags in
Oxygen XML Author Eclipse plugin is very simple with several methods for
selecting entire elements:
- Breadcrumb - Click the element (XML tag) on the breadcrumb displayed at the top of the editing window.
- Outline View - Click the element name in the Outline
view.
- Full Tags Mode - While editing in Full
Tags mode, click the start or end tag of the element in the
editor.
- Mouse Selection - While editing in Full
Tags mode, click before the start tag of the element, drag the
selection, and release the mouse button after the end tag.
- Shift + Arrow Keys - While editing in Full
Tags mode, place the cursor before the start tag of the element,
press and hold Shift, and use the arrow keys
to make the selection (including the end tag).
Note: If the selection does not include the entire element (for example you do not
include the end tag of the element),
Oxygen XML Author Eclipse plugin will automatically close the
appropriate tags when pasting the copied selection. This ensures that the pasted content
will always result in
well-formed
XML.
Using the Breadcrumb in Author Mode
A breadcrumb on the top stripe indicates the path from document root to the current
element. It can also be used as a helpful tool to insert and edit specific elements in the
document structure.
Figure 1. Breadcrumb in Author Mode
Tip: The tag names displayed in the
breadcrumb can be customized
with an
Author mode extension class that implements the
AuthorBreadCrumbCustomizer API. See the
Oxygen
SDK for more details.
Move Nodes
You can move XML nodes in the current document by using the following actions in the
Refactoring submenu of the contextual menu:
- Move Up (Alt + UpArrow (Option +
UpArrow on macOS))
- Moves the current node or selected nodes in front of the previous node.
- Move Down (Alt + DownArrow
(Option + DownArrow on macOS))
- Moves the current node or selected nodes after the subsequent node.
Tip: The easiest way to move nodes is to use the Alt + UpArrow (Option +
UpArrow on macOS) and
Alt + DownArrow
(Option + DownArrow on macOS) shortcut keys.
Join or Split Elements
You can join or split elements in the current document by using the following actions in
the Refactoring submenu of the contextual menu:
Join
Elements
- Joins two adjacent block
elements that have the same name. The action is available only when the
cursor position is between the two adjacent block elements. Also, joining
two block elements can be done by pressing the
Delete or
Backspace keys and the cursor is
positioned between the boundaries of these two elements.
Tip: Specifically, the
Delete or
Backspace keys can be used to join
block elements in the following situations:
- The cursor is located before the end position of the first element and
Delete key is pressed.
- The cursor is located after the end position of the first element and
Backspace key is pressed.
- The cursor is located before the start position of the second element and
Delete key is pressed.
- The cursor is located after the start position of the second element and
Backspace key is pressed.
If the element has no sibling or the sibling element has a different name, an
Unwrap operation will be performed.
Split
Element
- Splits the content of the closest element that contains the position of the cursor.
Thus, if the cursor is positioned at the beginning or at the end of the element, the
newly created sibling will be empty.
Rename Elements
You can rename elements by using the following action in the
Refactoring submenu of the contextual menu:
Rename
Element
- The element from the cursor position, and any elements with the same name, can be
renamed according with the options from the Rename dialog
box.
Surround Content with Tags (Wrap)
You can surround a selection of content with tags (wrap the content) by using
the following action in the Refactoring submenu of the contextual
menu:
Surround with Tags
(Alt + Shift +
E)
- Allows you to choose a tag to enclose a selected portion of content. If there is no
selection, the start and end tags are inserted at the cursor position.
Surround with '[tag]'
(Alt +
Shift + ForwardSlash)
- Surround the selected content with the last tag used.
Unwrap the Content of Elements
You can unwrap the content of an element by using the following action in the
Refactoring submenu of the contextual menu:
Delete Element Tags
- Deletes the tags of the closest element that contains the position of the cursor. This
operation is also executed if the start or end tags of an element are deleted by
pressing the Delete or
Backspace keys.
Tip: Specifically, the
Delete or
Backspace keys can be used to unwrap the
content of an element in the following situations:
- The cursor is located before the start position of the element and
Delete key is pressed.
- The cursor is located after the start position of the element and
Backspace key is pressed.
- The cursor is located before the end position of the element and
Delete key is pressed.
- The cursor is located after the end position of the element and
Backspace key is pressed.
If the element has no sibling or the sibling element has a different name, an
Unwrap operation will be performed.
Remove Markup from Blocks of Content
You can remove the markup from the current element by highlighting the appropriate block of
content and using the following action in the Refactoring submenu of
the contextual menu:
Remove
All Markup
- Removes all the XML markup inside the selected block of content and keeps only the
text content.
Tip: You can use the Delete or
Backspace keys to remove markup, in which
case the elements in the selected block will be unwrapped or joined with their sibling, or
if the current element is empty, the element tags will be deleted.
Remove Text from Selected Markup
You can remove the text from elements by highlighting the appropriate block of content and
using the following action in the Refactoring submenu of the
contextual menu:
Remove
Text
- Removes the text content of the selected block of content and keeps the markup intact
with empty elements.
Other Refactoring Actions
You can also manage the structure of the markup by using the other specific XML refactoring
actions that are available in the Refactoring submenu of the
contextual menu:
- DITA-related Refactoring Actions
-
A variety of built-in XML refactoring operations that pertain to DITA documents with
some of the information preconfigured based upon the current context.
- Change Topic ID to File Name
- Use this operation to change the ID of a topic to be the same as its file
name.
- Convert CALS Tables to Simple Tables
- Use this operation to convert DITA CALS tables to simple tables. If you invoke
this operation from a nested table (a table inside a table), only the nested
table will be affected. If it is invoked on a parent table that contains nested
tables, all of the contained tables will be converted.
- Convert conrefs to conkeyrefs
- Use this operation to convert
@conref attributes to
@conkeyref attributes.
- Convert Simple Tables to CALS Tables
- Use this operation to convert DITA simple tables to CALS tables. If you invoke
this operation from a nested table (a table inside a table), only the nested
table will be affected. If it is invoked on a parent table that contains nested
tables, all of the contained tables will be converted.
- Convert to Concept
- Use this operation to convert a DITA topic (of any type) to a DITA Concept
topic type (for example, Topic to Concept).
- Convert to General Task
- Use this operation to convert a DITA topic (of any type) to a DITA General
Task topic type (for example, Task to General Task). A DITA General
Task is a less restrictive alternative to the Strict Task
information type.
- Convert to Reference
- Use this operation to convert a DITA topic (of any type) to a DITA Reference
topic type (for example, Topic to Reference).
- Convert to Task
- Use this operation to convert a DITA topic (of any type) to a DITA Task topic
type (for example, Topic to Task).
- Convert to Topic
- Use this operation to convert a DITA topic (of any type) to a DITA Topic (for
example, Task to Topic).
- Convert to Troubleshooting
- Use this operation to convert a DITA topic (of any type) to a DITA
Troubleshooting topic type (for example, Topic to Troubleshooting).
- Rename Key
- Available when invoked on a key, and can be used to quickly rename a key. It
also updates all references to it. Note that it does not work on DITA 1.3 key
scopes.
- Generate IDs
- Use this operation to automatically generate unique IDs for elements.
- Attributes Refactoring Actions
-
Contains built-in XML refactoring operations that pertain to
attributes with some of the information preconfigured based upon the current
context.
- Add/Change attribute
- Allows you to change the value of an attribute or insert a new one.
- Convert attribute to element
- Allows you to change an attribute into an element.
- Delete attribute
- Allows you to remove one or more attributes.
- Rename attribute
- Allows you to rename an attribute.
- Replace in attribute value
- Allows you to search for a text fragment inside an attribute value and change
the fragment to a new value.
- Comments Refactoring Actions
-
Contains built-in XML refactoring operations that pertain to
comments with some of the information preconfigured based upon the current
context.
- Delete comments
- Allows you to delete comments found inside one or more elements.
- Elements Refactoring Actions
-
Contains built-in XML refactoring operations that pertain to elements with some of
the information preconfigured based upon the current context.
- Delete element
- Allows you to delete elements.
- Delete element content
- Allows you to delete the content of elements.
- Insert element
- Allows you to insert new elements.
- Rename element
- Allows you to rename elements.
- Unwrap element
- Allows you to remove the surrounding tags of elements, while keeping the
content unchanged.
- Wrap element
- Allows you to surround elements with element tags.
- Wrap element content
- Allows you to surround the content of elements with element tags.
- Fragments Refactoring Actions
-
Contains built-in XML refactoring operations that pertain to XML fragments with some
of the information preconfigured based upon the current context.
- Insert XML fragment
- Allows you to insert an XML fragment.
- Replace element content with XML fragment
- Allows you to replace the content of elements with an XML fragment.
- Replace element with XML fragment
- Allows you to replace elements with an XML fragment.
Copying XML Content in Author Mode to the Clipboard
It is possible to copy the XML structure of a document to the system clipboard. Simply
select the XML content in Author mode (for example, by selecting an
element in the breadcrumb), and select . The system clipboard will now contain the corresponding XML structure.