Shaun McCance
shaunm@gnome.org 2008-2009
Create simple trees to show heirarchical structures.

# Tree Lists

    mal_block_tree = element tree {
      attribute style { xsd:NMTOKENS } ?,
      attribute * - (mal:* | local:*) { text } *,

      mal_block_title ?,
      mal_tree_item +
    }
    mal_tree_item = element item {
      attribute style { xsd:NMTOKENS } ?,
      attribute * - (mal:* | local:*) { text } *,

      mal_inline,
      mal_tree_item *
    }

Use the `tree` element to create a heirarchical tree. While conceptually similar to nested `list` elements, trees offer a simple way to display common heirarchies such as class inheritance or directory layouts.

# Notas

The `tree` element can contain an optional `title` element followed by one or more `item` elements. Each child `item` element can contain a mixture of text and any general inline elements, followed by zero or more nested `item` elements.

The `tree` element can occur in any general block context, including inside pages, sections, and certain block elements.

The `style` attribute takes a space-separated list of style hints. Processing tools should adjust their behavior according to those style hints they understand.

The following style hints are recommended:

`líneas` | draw lines to show the hierarchy

The `tree` element can have attributes from external namespaces. See for more information on external-namespace attributes.

# Ejemplos

Use a tree to outline a class heirarchy inside a `>synopsis` element:

<synopsis> <tree> <item> <code>GtkBin</code> <item> <code>GtkButton</code> <item><code>GtkToggleButton</code></item> <item><code>GtkColorButton</code></item> <item><code>GtkFontButton</code></item> <item><code>GtkLinkButton</code></item> <item><code>GtkOptionMenu</code></item> <item><code>GtkScaleButton</code></item> </item> </item> </tree> </synopsis>

              GtkBin

                GtkButton
                GtkToggleButton
                GtkColorButton
                GtkFontButton
                GtkLinkButton
                GtkOptionMenu
                GtkScaleButton

Use the `lines` style hint to visually show the tree structure:

<tree style="lines"> <item> Anatinae (dabbling ducks) <item> Anas <item>Baikal Teal</item> <item>Wigeons</item> <item>Mallard</item> </item> <item>Lophonetta</item> <item>Speculanas</item> </item> <item> Anthyinae (diving ducks) <item>Aythya</item> <item>Netta</item> </item> <item>Dendrocygninae (whistling ducks)</item> </tree>
Anatinae (dabbling ducks) Anas Baikal Teal Wigeons Malla Lophonetta Speculanas
Anthyinae (diving ducks) Aythya Netta
Dendrocygninae (whistling ducks)

# Processing Expectations

Tree lists are display as block elements. Each child `item` has its leading inline content displayed in a single block and any nested `item` elements displayed as blocks in turn. Successive levels of nesting should yield more indentation, though this may vary based on style hints or other factors. By default, there should be little vertical spacing between items; trees are compact. No bullets, icons, or other marks are expected to precede items, although they may be used for certain style hints.