WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.
Example: Recursive tree with two columns
This tree displays two columns, one for the animal name and the other for the number of specimens. A binding is used for the specimens instead of a triple because only the animals have this predicate, not the containers.
<tree rows="10" datasources="animals.rdf"
ref="http://www.some-fictitious-zoo.com/all-animals">
<treecols>
<treecol id="name" label="Name" primary="true" flex="1"/>
<treecol id="specimens" label="Specimens" flex="1"/>
</treecols>
<template>
<rule>
<conditions>
<content uri="?uri"/>
<member container="?uri" child="?animal"/>
<triple subject="?animal"
predicate="http://www.some-fictitious-zoo.com/rdf#name"
object="?name"/>
</conditions>
<bindings>
<binding subject="?animal"
predicate="http://www.some-fictitious-zoo.com/rdf#specimens"
object="?specimens"/>
</bindings>
<action>
<treechildren flex="1">
<treeitem uri="?animal">
<treerow>
<treecell label="?name"/>
<treecell label="?specimens"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
