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.

nsIXULTemplateQueryProcessor

IID:970f1c36-5d2e-4cbc-a1cf-e3327b50df71
Inherits From:nsISupports

A query processor takes a template query and generates results for it given a datasource and a reference point. There is a one-to-one relationship between a template builder and a query processor. The template builder creates the query processor, and there is no other means to retrieve it.

A template query is the contents inside a element within the template. The actual syntax is opaque to the template builder and defined by a query processor. The query is expected to consist of either text or DOM nodes that, when executed by a call to the generateResults method, will allow the generation of a list of results.

The template builder will supply two variables, the reference variable and the member variable to further indicate what part of the datasource is to be examined in addition to the query itself. The reference is always a placeholder for the starting point and the member is always a placeholder for the end points (the results).

The reference point is important when generating output recursively, as the query will be the same for each iteration, however, the reference point will differ.

For instance, when examining an XML source, an XML query processor might begin at the node referred by the reference variable and end at a list of that node's children.

Some queries may not need the reference variable if the syntax or the form of the data implies the value. For instance, a datasource that holds a table that can only produce one set of results.

The reference variable may be specified in a template by setting the "container" attribute on the