Content Completion Assistant
Oxygen XML Web Author includes a useful feature called the Content Completion Assistant to help you insert valid XML content. It offers a list of elements, attributes, attribute values, and other options that are valid at the current location. It tries to determine the most logical choice in the current editing context and displays that proposal at the beginning of the list.
It also shows elements that are invalid at the current location, but they are rendered in a lighter shade of gray, italicized, and appear after the valid proposals. You can use the search field at the top of the Content Completion Assistant to quickly navigate to the desired element and it dynamically displays proposals that begin with the characters entered in the search field.
Using the Content Completion Assistant
To activate the feature, tap or press Enter.
On mobile devices, you can swipe up or down to scroll through the list and a proposal can be selected by simply tapping it.
On desktop devices, you can navigate through the list of proposals by using the Up and Down arrow keys and to insert the selection, simply press Enter.
Examples of How the Content Completion Assistant Works
-
New Element - If the cursor is positioned at the beginning or at the end of an element, the first item offered is a New <Element> item. Selecting this item will insert an empty element.
-
Split Element - If the cursor is positioned somewhere inside the element, the first entry is a Split <Element> item. In most cases, you can only split the closest block element to the cursor position, but if it is inside a list item, the list item will also be proposed for split.
-
New Line - If the cursor is positioned inside a space-preserved element (for example, a
<codeblock>
), the first choice is Enter and it will insert a new line in the content of the element. -
Multi-element Insertions - Some element proposals require additional items to be inserted to make the structure valid. In some cases, the additional items are inserted automatically. In some cases, the element proposal will open a dialog box to prompt the user for additional information to make it easier and faster to insert the whole structure at once.
For example, if you are editing a DITA map document, you can insert a reference to an existing topic by selecting the Topic Reference proposal and it will open a dialog box where you can choose the target. Similarly, selecting the Topic Reference (New Topic) proposal will open a dialog box where you can choose a template for creating a new DITA topic and it will create the new topic and insert a reference to it in the map.