This section describes the data binding facilities of XUL, called templates. A XUL template allows a content author to present live data as arbitrary XUL elements, without writing complex content construction and synchronization code.
A template is a collection of rules that are used to build XUL content from one or more datasources, and is how an author embeds data into a XUL document. A template specifies a content pattern of XUL elements, along with the conditions indicate when the pattern should be used. XUL elements are constructed by copying the pattern and substituting appropriate values derived from the datasource. If the information in the datasource changes, the content is altered accordingly. This page is still under construction.
A XUL template builds its content from one or more datasources. A datasource is a collection of tuples that form an RDF [*] data model. The tuples from each datasource are merged, and treated as a single RDF data model.
Each tuple consists of a subject, a predicate, and an object. The subject of the tuple must be a resource in RDF sense; the predicate must be a property, and the object may either be a resource or a literal.
For example, the following tuples describe the contents of a simple address book:
Tuples may be interpreted as a labelled, directed graph. The above example yields a graph as follows:
datasources attribute may be specified on any XUL
element. This attribute indicates the list of the datasources that
should be used to build the template's content. The attribute should
be a whitespace-separated list of URIs that identify individual RDF
datasources; for example, the URLs of RDF/XML data files.
A XUL template may be used with the outliner widget. In this case, the XUL template is not used to build a content model; instead, it implements a view for the outliner object.