Editing XML Markup in Author Mode

Oxygen XML Editor 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.

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)
Moves the current node or selected nodes in front of the previous node.
Move Down (Alt + DownArrow)
Moves the current node or selected nodes after the subsequent node.
Tip: The easiest way to move nodes is to use the Alt + UpArrow and Alt + DownArrow shortcut keys.

Promote/Demote List Item Nodes

You can easily promote or demote list item nodes within ordered lists or unordered lists by using the following keyboard shortcuts:
Promote (Shift + Tab)
Promotes the current list item node to be a sibling of its parent node (the list item is moved to the left). It also works for selections of multiple list item nodes as long as all the selected nodes are siblings (on the same hierarchical level).
Demote (Tab)
Demotes the current list item node (the list item is moved to the right). It also works for selections of multiple list item nodes as long as all the selected nodes are siblings (on the same hierarchical level).

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 in tact 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:

Attributes submenu
Contains predefined XML refactoring operations that pertain to attributes. Oxygen XML Editor plugin considers the editing context to get the names and namespaces of the element or attribute for which the contextual menu was invoked, and uses this information to preconfigure some of the parameter values for the selected refactoring operation.
Add/Change attribute
Allows you to change the value of an attribute or insert a new one.
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.
Elements submenu
Contains predefined XML refactoring operations that pertain to elements. Oxygen XML Editor plugin considers the editing context to get the names and namespaces of the element or attribute for which the contextual menu was invoked, and uses this information to preconfigure some of the parameter values for the selected refactoring operation.
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 submenu
Contains predefined XML refactoring operations that pertain to XML fragments. Oxygen XML Editor plugin considers the editing context to get the names and namespaces of the element or attribute for which the contextual menu was invoked, and uses this information to preconfigure some of the parameter values for the selected refactoring operation.
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.