Editing XML Markup in Text Mode
Oxygen XML Editor includes some useful actions that allow you to easily edit XML markup in Text mode. These actions are available in the Refactoring submenu of the contextual menu and in the menu, and many of the actions can also be done with simple keyboard shortcuts.
Using the Breadcrumb
A breadcrumb on the top stripe indicates the path from the document root element to the current element. It can also be used as a helpful tool to insert and edit specific elements in the document structure.
Figure: Breadcrumb in Text Mode
The last element listed in the breadcrumb is the element at the current cursor
position. The current element is also highlighted by a
thin light blue bar for easy identification. Clicking an element in the
breadcrumb selects the entire element in the editor area. Also, each element
provides a contextual menu with access to the following actions:
- Append Child
- Allows you to select an element (from a drop-down list) that is allowed by the associated schema and inserts it as a child of the current element.
- Insert Before
- Allows you to select an element (from a drop-down list) that is allowed by the associated schema and inserts it immediately before the current element, as a sibling.
- Insert After
- Allows you to select an element (from a drop-down list) that is allowed by the associated schema and inserts it immediately after the current element, as a sibling.
- Edit Attributes
- Opens an editing window that allows you to edit the attributes of the currently selected element.
Toggle
Comment- Encloses the currently selected element in an XML comment, if the element is not already commented. If it is already commented, this action will remove the comment.
Cut- Removes the selected element and copies it to the clipboard.
Copy- Copies the selected element to the clipboard.
Delete- Deletes the currently selected element.
Move Nodes
You can easily move XML nodes in the current document by using the following shortcut keys:- Alt + UpArrow
- Moves the current node or selected nodes in front of the previous node.
- Alt + DownArrow
- Moves the current node or selected nodes after the subsequent node.
Rename Elements
You can rename elements by using the following actions in the Refactoring submenu of the contextual menu (or from the 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.
Rename
Prefix (Alt + Shift + P
(Command + Shift + P on OS X))- The prefix of the element from the cursor position, and any elements with the same
prefix, can be renamed according with the options from the Rename
dialog box.
- If you select the Rename current element prefix option, the
application will recursively traverse the current element and all its children.
For example, to change the
xmlns:p1="ns1"association in the current element toxmlns:p5="ns1", if thexmlns:p1="ns1"association is applied on the parent element, then Oxygen XML Editor will introducexmlns:p5="ns1"as a new declaration in the current element and will change the prefix fromp1top5. Ifp5is already associated with another namespace in the current element, then the conflict will be displayed in a dialog box. By pressing OK, the prefix is modified fromp1top5without inserting a new declaration. - If you select the Rename current prefix in all document option, the application will apply the change on the entire document.
- To also apply the action inside attribute values, check the Rename also attribute values that start with the same prefix checkbox.
- If you select the Rename current element prefix option, the
application will recursively traverse the current element and all its children.
For example, to change the
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 (or from the menu):
Surround with submenu- Presents a drop-down menu that allows you to choose a tag to surround a selected portion of content.
Surround with Tags (Ctrl + E (Command + E on
OS X) )- Allows you to choose a tag that encloses a selected portion of content. If there is no
selection, the start and end tags are inserted at the cursor position.
- If the Position cursor between tags option is enabled in the Content Completion preferences page, the cursor is placed between the start and end tag.
- If the Position cursor between tags option is disabled in the Content Completion preferences page, the cursor is placed at the end of the start tag, in an insert-attribute position.
Surround with '[tag]' (Ctrl +
ForwardSlash (Command + ForwardSlash on OS X))- 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 (or from the menu):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 (or from the menu):
Join
elements (Alt + Shift + J
(Command + Alt + J on OS X))- Joins the left and right elements relative to the current cursor position. The elements must have the same name, attributes, and attributes values.
Split
element
(Alt + Shift + D
(Ctrl + Alt + D on OS X))- Split the element from the cursor position into two identical elements. The cursor must be inside the element.
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 (or from the menu):- Attributes submenu
- Contains predefined XML refactoring operations that pertain to attributes. Oxygen XML Editor 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.
- Elements submenu
- Contains predefined XML refactoring operations that pertain to elements. Oxygen XML Editor 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.
- Fragments submenu
- Contains predefined XML refactoring operations that pertain to XML fragments. Oxygen XML Editor 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 tags (