Intelligent XML EditingContext Sensitive Content Assistant<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. Support for Showing Recent Content ItemsThe 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 XSL stylesheet, you are using a small
fraction from all the set of XSL 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 XSL elements were moved
above the ones from the XHTML grammar. Support for Learning WordsYou 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. Content Assistant for Documents Without a Schema 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. Configurable Content Assistant BehaviourThere 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. Support for IDREFs<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. Support for the Enumerations.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. Automatic Generation of Required ContentTo 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! Code TemplatesDocument 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 XSL 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 imported using the import function and the
current code templates are located in a file called code_templates.xml
in the <oXygen/> preferences directory (e.g. [user-home]/Application
Data/com.oxygenxml on Windows platform). XML Markup Contrast AdjusterThe 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! Matching Tag Highlight and NavigationWhen 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. Automatic editing of the matching end tagIt 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. Lock/Unlock XML TagsThis 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. FoldingXML 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. Optional Content GenerationWhen 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. |