XUL:Templates Plan: Difference between revisions

no edit summary
m (Typo in example)
No edit summary
Line 350: Line 350:
       sortActive="true"
       sortActive="true"
       sort="?var">
       sort="?var">
   <template processor="{query-processor-name}"
   <template type="{query-processor-name}"
             container="?ref"
             container="?ref"
             member="?member"
             member="?member"
Line 401: Line 401:
Recursion is controled in one of two ways. The 'dont-recurse' flag disables  it for all generated results. If the flag is omitted, the results are queried for a default value. This allows RDF to still be recursive while other types are not. There should also be some determination based on the element tag used.
Recursion is controled in one of two ways. The 'dont-recurse' flag disables  it for all generated results. If the flag is omitted, the results are queried for a default value. This allows RDF to still be recursive while other types are not. There should also be some determination based on the element tag used.


The second method is to add a 'template' attribute on an element inside the action, pointing to another <template> via its id. The causes that template to be parsed and used for child generation.
The second method is to add an element or attribute (to be determined) inside the action, pointing to another <template> via its id. The causes that template to be parsed and used for child generation.


It isn't clear at this point whether recursion which generates a result with the
It isn't clear at this point whether recursion which generates a result with the
Line 420: Line 420:
   <datasource id="thesource" type="xml" src="<nowiki>http://www.example.com/data</nowiki>"/>
   <datasource id="thesource" type="xml" src="<nowiki>http://www.example.com/data</nowiki>"/>


The datasource element will look up a datasource loader of the given type (in the example "xml"), probably by appending the type to a contract id as rdf: datasources are currently done. This will retrieve the datasource from the src attribute and supply it to the template builder. Multiple templates may refer to the same <datasource> element; in this case the source is only loaded once and shared by all templates that refer to it.
The datasource element will look up a datasource loader of the given type (in the example "xml"), probably by appending the type to a contract id as rdf: datasources are currently done. This will retrieve the datasource from the src attribute and supply it to the template builder. Multiple templates may refer to the same <datasource> element; in this case the source is only loaded once and shared by all templates that refer to it. Datasources may load asynchronously and will callback to the template builder to start generation.


If there is no src attribute, the tag itself it used as the xml datasource.
If there is no src attribute, the tag itself it used as the xml datasource.
287

edits