History | Edit

Oxygen XML Editor allows you to declare some elements to be foldable. This is especially useful when working with large documents organized in logical blocks, editing a large DocBook article or book, for instance. Oxygen XML Editor marks the foldable content with a small blue triangle. When you hover with your mouse pointer over this marker, a dotted line borders the collapsible content. The following actions are available in the Folding submenu of the contextual menu:
Toggle Fold
Toggles the state of the current fold.
Collapse Other Folds (Ctrl + NumPad/ (Command + NumPad/ on OS X))
Folds all the elements except the current element.
Collapse Child Folds (Ctrl + NumPad. (Command + NumPad. on OS X))
Folds the elements indented with one level inside the current element.
Expand Child Folds
Unfolds all child elements of the currently selected element.
Expand All (Ctrl + NumPad* (Command + NumPad* on OS X))
Unfolds all elements in the current document.
To define the element whose content can be folded by the user, you must use the property: -oxy-foldable:true;. To define the elements that are folded by default, use the -oxy-folded:true property.
Note: The -oxy-folded property works in conjunction with the -oxy-foldable property. Thus, the folded property is ignored if the -oxy-foldable property is not set on the same element.
When collapsing an element, it is useful to keep some of its content visible (for example, a short description of the collapsed region). The property -oxy-not-foldable-child is used to identify the child element that is kept visible. It accepts as value an element name or a list of comma separated element names. The first child element from the XML document that appears in the list of element names will be identified as the not foldable child and displayed. If the element is marked as foldable (-oxy-foldable:true;) but it doesn't have the property -oxy-not-foldable-child or none of the specified non-foldable children exists, then the element is still foldable. In this case the element kept visible when folded will be the before pseudo-element.
Note: Deprecated properties foldable, not-foldable-child, and folded are also supported.

Example: Folding DocBook Elements

All the elements below can have a title child element and are considered to be logical sections. You mark them as being foldable leaving the title element visible.
set,
book,
part,
reference,
chapter,
preface,
article,
sect1,
sect2,
sect3,
sect4,
section,
appendix,
figure,
example,
table {
    -oxy-foldable:true;
    -oxy-not-foldable-child: title;
}