XUL Template Primer - Outliner
Contents
OverviewExample
The
outlinerrow
conditionThe
outlinerrow
actionThe
outlinercell
actionRelated Documents
Overview
This document expands on the XUL Template Primer by illustrating how a XUL template can be used as the view for a XUL outliner.
Example
To illustrate how a template can be used as a view for an outliner, we'll examine this XUL document, which builds an outliner view from the contents of an RDF/XML file. The
This uses the same RDF/XML file that we used in the
nested content
example,
toc.rdf
.
The dont-build-content
flag
The dont-build-content
flag instructs the
builder not to create a content model, and instead go to
the RDF datasource directly for each cell that is to be displayed.
The dramatically reduces the amount of memory required for a large
datasource, as no XUL content model will be constructed in memory.
You may optionally set the properties
attribute on the
<treeitem>
to a whitespace-separted list of
varaibles (e.g. ?var
) or constants. These will be
atomized, and returned to the outliner as the properties
that apply to the current row.
The treeitem
condition
The <treeitem>
element, when used in a rule's
<conditions>
, is analogous to the
<content>
test in a content-model based
template. Specifically, it will match a row in the tree, and bind
the variable specified by the uri
attribute to that
row's URI (i.e., the URI in the RDF graph to which the row
corresponds).
Related Documents
- XUL Template Primer
- XUL template basics.
- XUL Template Primer - Bindings
-
Illustrates how to use the
<bindings>
tag in your XUL templates. - XUL Template Primer - Multiple Rules
-
Illustrates how to write templates with multiple
<rule>
elements. - XUL Template Primer - Nested Content
- Illustrates how a template can be used recursively to build nested content.
- XUL Template Reference
- Describes the simple XUL template syntax in detail.