Editing XML Markup in Text ModeEdit online
Oxygen XML Editor plugin 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 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.
- 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:
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 plugin 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, select 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:
Surround with Tags (Alt + Shift +
E)- 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 selected in the Content Completion preferences page, the cursor is placed between the start and end tag.
- If the Position cursor between tags option is not selected 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]' (Alt +
Shift + ForwardSlash)- Surround the selected content with the last tag used.
- Surround with <![CDATA]]> (Alt + Shift + C (Command + Alt + C on OS X))
- Surround the selected content with a
CDATAtag so that the parser will interpret it as textual data rather than markup.
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 (Alt +
Shift + Comma)- Deletes the start and end tag of the current element.
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 (Alt + Shift + F
(Command + Alt + F 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
- 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:
- 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.
- DITA 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
conrefattributes toconkeyrefattributes. - 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.
- 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.
- JATSKit Refactoring Actions
- Contains built-in XML refactoring operations that pertain to JATS documents with some
of the information preconfigured based upon the current context.
- Add BITS DOCTYPE - NLM/NCBI Book Interchange 2.0
- Adds an NLM 'BITS' 2.0 DOCTYPE declaration.
- Add Blue DOCTYPE - NISO JATS Publishing 1.1
- Adds a JATS 'Blue' 1.1 DOCTYPE declaration.
- Normalize IDs
- Assigned IDs are normalized and IDs are assigned to some elements that are missing them.