<oXygen/> offers the list of elements, attributes and attribute values through a content completion assistant. Unlike other editors that offer all the available entries, for example all the element names defined by the document XML Schema, <oXygen/> shows only those entries valid in the editing context. In this way the XML document is kept valid most of the time and the user does not have to know about the relations between elements.
In the following sample you can see that the list of possible elements for "tgroup" element contains "colspec", "tbody" and "thead" which is exactly what the DocBook DTD has defined.
The proposals that are actually used by the user are promoted at the top of the content completion list thus making their reuse easy.
For example, when editing an XSLT stylesheet, you are using a small fraction from all the set of XSLT and HTML elements. By placing the recent ones up in the list, it is faster to find them next time you want to use them.
In the next image you can see that the four XSLT elements were moved above the ones from the XHTML grammar.
You need to turn this on as it is disabled by default. All the words in the document will be indexed as they are written. When you enter a word prefix and press CTRL+Space all the words starting with that prefix are presented through the content completion window.
If there is a schema associated to the edited document then <oXygen/> will analyze it and initialize the content assistant.
In case the document has no associated schema then the content completion is initialized by examining the edited document and by learning its structure. Another way is for one to specify in the options the default XML Schema or DTD to be used.
Note that the learned structure can be saved to a DTD file and can be used as a skeleton for further development.
There are many settings that customize the operating mode of the content assistant. For example you can enable or disable the generation of the required content or modify the way the cursor is positioned after an insertion.
<oXygen/> will present the ID values collected in the last validate action on the content completion proposals where an IDREF or an IDREFS type is specified. This works not only with documents that have an associated DTD but also with documents that have an XML Schema or a Relax NG schema associated.
In the following sample you can see the content completion list containing all the IDs displayed when creating a link. The attribute "linkend" is defined as IDREF (a reference to an ID value). The document has associated the DocBook DTD.
When an attribute value is of type anyURI (in both XML Schema and Relax NG schema) <oXygen/> will present proposals of the form #ID for each defined ID value in the document.
The Content Assistant offers proposals for attributes and elements values that have as type an enumeration of tokens. This is available for documents that make use of XML Schema or Relax NG Schema.
In the next image the attribute "list" of "root" has been defined as a list of decimal values: 1.44, 2.88, 3 and 5.
To speed up the content creation <oXygen/> automatically inserts the required attributes of an element and also the required element content of the inserted element. In the following example you can see how an entire subtree is generated just by selecting an element. You will create valid content with minimum effort!
Document fragments can be defined and reused while editing. The template list can be obtained by using the Content Completion on request shortcut (CTRL-SPACE). <oXygen/> comes with a large number of ready-to use templates for XSLT and XML Schema.
For example in the following image you can see how the "copy template" has been defined. After insertion the caret will be positioned after the line of the "xsl:template" closing tag.
The templates can be shared using the export/import actions.
The contrast control button allows you to change the transparency levels for XML markup or text. This way you can change the focus of attention from markup to text and vice versa. The transparent markup option combined with locking the tags can be used for safe and easy editing!
When having the cursor inside a tag name both the start-tag and the end-tag are underlined in order to provide immediate focus on the current element. You can move the cursor to the matching tag using an action from the popup menu.
It is a lot easy to rename elements in <oXygen/>. When the start tag of an XML element is edited then the matching end tag is automatically changed thus keeping the XML document well formed and saving you a few keystrokes. This behavior is controlled from the user preferences.
This is very useful when you edit forms like XML documents or XML templates. This way you can protect the markup from accidental change and modify only the text sections.
XML documents have a tree structure. The folding allows you to collapse elements leaving in the focus only the ones you need to edit. An unique feature of <oXygen/> is the fact that the folds are persistent: the next time you will open the document the folds are restored to the last state so you continue to work from where you left. For non XML files the folding strategy is to collapse blocks of text that have the same indent.
In the next image you can see that only one of the chapter sections is expanded and the rest are collapsed. The folds show in the right side the number of lines that were collapsed.
To make the fold operation faster you can use the contextual menu to collapse or expand all the child folds of an element.
When creating a new XML document the editor generates the content of the root element based on the required elements as it was specified in the associated schema or DTD. There are available two options to make the content generation process take into account also optional content and choice models thus allowing to obtain more content for the new document.
In the next figure the "site" element was chosen as the root of the new document. The checkboxes above the text show the settings from the "New document" dialog. You can see that activating the optional content generation options implies more generated content.