The intelligent Content Completion Assistant available in Oxygen XML Editor enables rapid, in-line
identification and insertion of structured language elements, attributes and, in some cases,
their parameter options.
Figure: Content Completion Assistant
The functioning of the Content Completion Assistant feature is schema-driven (XML Schema,
DTD, and RELAX NG). When Oxygen XML Editor
detects a schema, it logs its URL in the Information view.
The
Content Completion Assistant is enabled by
default. To disable it,
open the
Preferences dialog box and go to
. It is activated:
- automatically, after a configurable delay from the last key press of the <
character. You can adjust the delay from
the Content Completion preferences page
- on demand, by pressing Ctrl Space (Command Space on OS
X) on a partial
element or attribute name.
Note: If the Content Completion list contains only one valid
proposal, when you press the Ctrl Space (Command Space on OS
X) shortcut key,
the proposal is automatically inserted.
Note: You can also start the Content Completion Assistant from .
When active, it displays a list of context-sensitive proposals valid at
the current caret position. Elements are highlighted in the list using the Up and
Down cursor 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:
- press Enter or Tab on your keyboard to insert both the start and end
tags.
- press Ctrl Enter
(Command Enter on OS X)
on your keyboard. Oxygen XML Editor inserts both the start and end tags and positions
the cursor between the tags, so 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 (found in the
preferences page) is enabled. The
Content Completion
Assistant can also add optional content and first choice particle, as specified
in the DTD or XML Schema or RELAX NG schema. To activate this feature,
open the
Preferences dialog box, go to , and select the
Add optional content and
Add
first Choice particle check boxes.
After inserting an element, the cursor is positioned:
- before the > character of the start tag, if the element allows attributes, in order 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.
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.
The items 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 Editor checks
the uniqueness and correctness of the ID attributes. It also collects the attribute values
declared in the document to prepare the Content Completion Assistant's list of proposals. This
is available for documents that use DTD, XML Schema, and Relax NG schema.
Also, 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 as type an enumeration of tokens. Also,
if a default value or a 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.