oXygen offers the list of elements, attributes, and attribute values through a Content Completion Assistant. Unlike other editors that offer all the available entries (all the element names defined by the document XML Schema, for example), oXygen shows only those entries valid in the editing context. Therefore, the XML document is kept valid most of the time and the user does not have to know about the relationship between elements.
In the following image, you can see that the list of possible elements for the tgroup element contains colspec, tbody, and thead, which is exactly what the DocBook DTD has defined.
The proposals that have previously been used are promoted at the top of the content completion list, thus allowing for efficient re-use. For example, when editing an XSLT stylesheet, you use a small fraction from all the set of XSLT and HTML elements. By sorting the recently used ones to appear higher on the list, it is easier to find them the next time you want to use them.
In the following image you can see that the four XSLT elements that were previously used, appear above other elements of the XHTML grammar.
This feature is disabled by default, but when enabled all the words in the document are indexed as they are written. When you enter a word's prefix and press CTRL+SPACE, words starting with that prefix are presented through the content completion window.
If there is a schema associated with the edited document, then oXygen analyzes it and initialize the Content Completion Assistant. If the document has no associated schema then the Content Completion Assistant is initialized by examining the edited document and learning its structure. Alternatively, you can use the options page to set 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 Completion 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.
The oXygen Quick Fix support helps you resolve errors that appear in an XML document by offering quick fixes to problems such as missing required attributes or invalid elements. Quick fixes are available for XML documents that are validated against XSD, Relax NG, or Schematron schemas.
oXygen automatically analyzes the current error and proposes quick fixes in order to solve it in a single step. The quick fixes are available in both Text and Author editing modes.
oXygen displays the ID values collected in the last validate action on the content completion proposals where an IDREF or IDREFS type is specified. This not only works with documents that have an associated DTD but also with documents that have an XML Schema or Relax NG schema associated.
In the following image you can see the content completion list containing all the IDs displayed when creating a link. The attribute linkend is defined as an IDREF (a reference to an ID value).
When an attribute value is of the type anyURI (in both XML Schema and Relax NG schema) oXygen displays proposals of the form #ID for each defined ID value in the document.
oXygen offers support for search and refactoring operations for ID/IDREFS in XML documents that have an associated DTD, XML Schema, or Relax NG Schema. These operations are available in the Text mode and also in the Author mode.
In Text mode, the easiest way to access the search/refactoring action is by using the Quick Assist support. It is available when you position the caret inside an ID or an IDREF and click the yellow light bulb from the line-number stripe.
To see the occurrences of an ID in an XML document while in the Text mode, place the cursor inside the ID declaration or reference. The occurrences are marked in the vertical side bar at the right of the editor. Click a marker on the side bar to navigate to the occurrence that it corresponds to. The occurrences are also highlighted in the editing area.
The Content Completion Assistant offers proposals for attributes and element values, whose type is an enumeration of tokens. This is available for documents that use XML Schema or Relax NG schema.
In the following image the attribute list of root has been defined as a list of decimal values (1.44, 2.88, 3.0, and 5.0) and the Content Completion Assistant offers proposals accordingly.
To speed up the content creation, oXygen automatically inserts the required attributes or content of an element. In the following image you can see how an entire subtree is generated just by selecting an element. This allows you to create valid content with minimum effort.
Document fragments can be defined and re-used while editing. The template list can be obtained with the Content Completion Assistant by using the keyboard shortcut CTRL+SPACE. oXygen includes a large number of ready-to-use templates for XSLT and XML Schema.
For example, in the following image you can see how Copy-Template has been defined. After insertion, the caret will be positioned after the xsl:template closing tag line.
Note that the templates can be shared using the Export and Import actions.
The contrast control button allows you to change the transparency levels for XML markup or text. Therefore, 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.
The relationship between XML resources that are referenced using XInclude and external entity mechanisms can be visualized and understood with the help of the Resource Hierarchy/Dependencies View.
When an XML resource is renamed or moved in the Project view, oXygen gives you the option to update that resource's references. The same option is available when you move or rename a resource in the Resource Hierarchy/Dependencies view.
When placing 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 the Go to Matching Tag action from the contextual menu.
It is easy to rename elements in oXygen. When the start-tag of an XML element is edited, the matching end-tag is automatically changed, thus keeping the XML document "well-formed" and saving you a few keystrokes. This behavior can be modified from the preferences page.
This allows you to protect the markup from accidental changes and to limit modifications to text sections. This is especially useful when editing XML documents or templates.
XML documents have a tree-like structure. Folding allows you to collapse elements, leaving only those that you need to edit in the focus. A unique feature of oXygen is the fact that the folds are persistent (the next time you open the document the folds are restored to the last state so you can continue to work from where you left off). For non-XML files, the folding strategy is to collapse blocks of text that have the same indent.
In the following image you can see that only one of the chapter sections is expanded and the rest are collapsed. The number of lines that were collapsed are listed in brackets on the right side of the folded elements.
To speed up the fold operation 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. Two options are also available to make the content generation process take into account optional content and choice models, thus allowing you to obtain more content for the new document.
In the following image, 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 produce more generated content.