13. elementVisibility

<elementVisibility>
  Content: [ category ]*
</elementVisibility>

<category
  name = Non-empty token
  elements = Non-empty list of QNames, 
             (a QName may optionnaly be followed 
              by a list of exceptions)
  visible = boolean : true
  merge = replace|add|remove : replace
/>

The elementVisibility configuration element specifies the checkbox entries of the menu displayed by clicking the down arrow button found at the right of the tool bar of the Edit tool in XMLmind XML Editor - Online Help. This menu lets the user toggle the visibility of elements belonging to certain categories. Simply uncheck a menu entry to “hide” in the Edit tool all the elements belonging to the corresponding category.

A menu entry is created for each category child. The elements of element category are:

name

Specifies the name of the category hence, once localized, the label of the corresponding menu entry.

elements

Specifies the names of the elements belonging to the category. These elements are to be hidden by the Edit tool when the corresponding menu entry is unchecked.

[Note]Exceptions

It's possible to append a list of exceptions after the name of an element to be hidden. This list of exception uses the following syntax:

'!' element_QName [ '|' element_QName ]*

XHTML5 example: html:script!html:head, which means element script is to be hidden, except when its ancestor element is html:head.

visible

Default value: true. Specifies the initial visibility of the category, hence whether he corresponding menu entry is initially checked or unchecked.

merge

Default value: replace. Specifies how the current definition of a category is merged with the previous definition of the same category. See example #2 below.

Examples:

<elementVisibility>
  <category name="Scripting" visible="false"
            elements="html:script!html:head
                      html:noscript
                      html:template
                      html:slot" />
</elementVisibility>

<elementVisibility/>

An elementVisibility element without any category child element may be used to remove from a configuration the previously defined elementVisibility.

Otherwise, an elementVisibility element is merged with the elementVisibility element previously defined in the configuration. This is done as follows:

  1. All category elements not found in current definition but found in the previous definition are copied from previous definition.

  2. All category elements having no elements child element are discarded from current definition. This trick allows to skip some category elements which otherwise would have been copied from the previous definition.

  3. Otherwise, how the current definition of a category is merged with the previous definition of the same category is specified by the merge attribute:

    replace

    Default value. Current definition of a category replaces the previous definition of the same category.

    add

    Elements found in current definition of a category are added to the elements found in the previous definition of the same category.

    remove

    Elements found in current definition of a category are removed from the elements found in the previous definition of the same category.

Example #2:

<elementVisibility xmlns:db="http://docbook.org/ns/docbook">
  <category name="Production" elements="db:productionset db:production"/>
  <category name="Message Set" visible="false"
            elements="db:msgset 
                      db:classsynopsis!db:refentry 
                      db:cmdsynopsis!db:refentry" />
</elementVisibility>

<elementVisibility xmlns:db="http://docbook.org/ns/docbook">
  <category name="Production" merge="add" visible="false"
            elements="db:lhs db:rhs db:constraint db:productionrecap" />
  <category name="Message Set" merge="remove" visible="true"
            elements="db:classsynopsis db:cmdsynopsis" />
</elementVisibility>

is equivalent to:

<elementVisibility xmlns:db="http://docbook.org/ns/docbook">
  <category name="Production" visible="false"
            elements="db:productionset db:production
                      db:lhs db:rhs db:constraint db:productionrecap" />
  <category name="Message Set" visible="true"
            elements="db:msgset" />
</elementVisibility>