Edit online

Oxygen XML Editor includes an intelligent Content Completion Assistant that offers proposals for inserting structured language elements, attributes, and attribute values that are valid in the current editing context.

The Content Completion Assistant is enabled by default. To disable it, open the Preferences dialog box (Options > Preferences), go to Editor > Content Completion, and deselect the Enable content completion option.

Figure 1. Content Completion Assistant

Content Completion and the Associated Schema

The Content Completion Assistant feature is schema-driven and the list of proposals in the Content Completion Assistant depend on the associated schemas (DTD, XML Schema, Relax NG, or NVDL schema). For information about the various ways to associate a schema and the order of their precedence, see the Associating a Schema to XML Documents section.

Using the Content Completion Assistant in Text Mode

The feature is activated in Text mode in the following situations:
  • After you enter the < character when inserting an element, it is automatically activated after a short delay. You can adjust the activation delay with the Activation delay of the proposals window (ms) option from the Content Completion preferences page.
  • After typing a partial element or attribute name, you can manually activate it by pressing Ctrl + Space (Command + Space on OS X) or Alt + ForwardSlash (Command + Alt + ForwardSlash on OS X). If there is only one valid proposal at the current location, it is inserted without displaying the list of proposals.

You can navigate through the list of proposals by using the Up and Down keys on your keyboard. In some cases, the Content Completion Assistant displays a documentation window with information about the particular proposal and some of them have links to additional information (for example, DITA elements might have a link to the DITA Style Guide). You can also change the size of the documentation window by dragging its top, right, and bottom borders.

To insert the selected proposal in Text mode, do one of the following:
  • Press Enter or Tab to insert both the start and end tags and position the cursor inside the start tag in a position suitable for inserting attributes.
  • Press Ctrl + Enter (Command + Enter on OS X) to insert both the start and end tags and positions the cursor between the tags in a position where you can start typing content.
Note: When the DTD, XML Schema or RELAX NG schema specifies required child elements for the newly added element, they are inserted automatically only if the Add Element Content option (in the Content Completion preferences page) is selected. The Content Completion Assistant can also add optional content and first choice particle, as specified in the DTD, XML Schema, or RELAX NG schema. To activate these features, select the Add optional content and Add first Choice particle options in the Content Completion preferences page.

After inserting an element, the cursor is positioned:

  • Before the > character of the start tag, if the element allows attributes, to allow rapid insertion of any of the attributes supported by the element. Pressing the space bar displays the Content Completion list once again. This time it contains the list of allowed attribute names. If the attribute supports a fixed set of parameters, the assistant list displays the list of valid parameters. If the parameter setting is user-defined and therefore variable, the assistant is closed to allow manual insertion. The values of the attributes can be learned from the same elements in the current document.
  • After the > character of the start tag, if the element has no attributes.

Where the Content Completion Assistant is Displayed

The Content Completion Assistant is displayed:

  • Anywhere within a tag name or at the beginning of a tag name in an XML document, XML Schema, DTD, or Relax NG (full or compact syntax) schema.
  • Anywhere within an attribute name or at the beginning of an attribute name in any XML document with an associated schema.
  • Within attribute values or at the beginning of attribute values in XML documents where lists of possible values have been defined for that element in the schema associated with the document.

Types of Proposals Listed in the Content Completion Assistant

The following things are considered for determining the proposals that are listed in the content completion window:
Element Structure Specified in DTD or Schema
The proposals that populate the Content Completion Assistant depend on the element structure specified in the DTD, XML Schema, Relax NG (full or compact syntax) schema, or NVDL schema associated with the edited document.
Note: The Content Completion Assistant is able to offer elements defined both by XML Schemas version 1.0 and 1.1.
Current Cursor Position
The number and type of elements displayed by the Content Completion Assistant is dependent on the cursor's current position in the structured document. The child elements displayed within a given element are defined by the structure of the specified DTD, XML Schema, Relax NG (full or compact syntax) schema, or NVDL schema.
Unique ID Attribute Values
A schema may declare certain attributes as ID or IDREF/IDREFS. When the document is validated, Oxygen XML Editor checks the uniqueness and correctness of the @id attributes. It also collects the attribute values declared in the document to prepare the list of proposals. This is available for documents that use DTD, XML Schema, and Relax NG schema.
Values for xml:id Attributes
Values of all the @xml:id attributes are handled as @id attributes. They are collected and displayed by the Content Completion Assistant as possible values for anyURI attributes defined in the schema of the edited document. This works only for XML Schema and Relax NG schemas.
Links/References in DITA
When entering values for the various types of links and references in DITA (for example, values for @href or @conref elements), the Content Completion Assistant will propose potential targets when you use the forward slash key (/).
ID Values for DITA Key References
In DITA, when inserting key references (@keyref) or content key references (@conkeyref), the ID values that are defined in the key reference are presented as possible targets. The Content Completion Assistant will only propose targets that are valid in the current context.
Element and Attribute Values
For documents that use an XML Schema or Relax NG schema, the Content Completion Assistant offers proposals for attribute and element values as long as the allowed values are defined in the schema. Also, if a default value or fixed value is defined in the schema, then that value is offered in the Content Completion Assistant.