Content Completion Assistant in Text Mode

Oxygen XML Developer plugin includes an intelligent Content Completion Assistant that offers rapid, in-line identification and insertion of structured language elements, attributes, and attribute values. Oxygen XML Developer plugin shows the available entries that are valid in the current editing context.

Content Completion Assistant

The Content Completion Assistant feature is schema-driven (XML Schema, DTD, and RELAX NG) and status information about the detected schema is logged in the Status view.

The Content Completion Assistant is enabled by default. To disable it, open the Preferences dialog box , go to EditorContent Completion, and disable the Enable content completion option.

Using the Content Completion Assistant in Text Mode

The feature is activated in Text mode in the following situations:

  • After you press 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 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.

When active, the Content Completion Assistant displays a list of context-sensitive proposals valid at the current cursor position. You can navigate through the list of proposals by using the Up and Down keys on your keyboard. For each selected item in the list, the Content Completion Assistant displays a documentation window. You can customize the size of the documentation window by dragging its top, right, and bottom borders.

To insert the selected content 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 enabled. 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 enable 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 enable 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:

  • 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.
  • 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.
  • A schema may declare certain attributes as ID or IDREF/IDREFS. When the document is validated, Oxygen XML Developer plugin 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 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.
  • For documents that use an XML Schema or Relax NG schema, the content assistant offers proposals for attributes and elements values that have an enumeration of tokens as the type. Also, if a default value or fixed value is defined in the XML Schema used in validation for an attribute or element, then that value is offered in the Content Completion Assistant window.

Was this helpful?