Menu

Templating

Csaba Skrabák

Templating is the generation of the final DOM that appears for the user of the web application. Source that the application developer writes is the bracy template. Templating then happens in two major steps:

  1. Transplating: the bracy template is transformed into an html document that can be downloaded to the browser. It contains html template elements and a data block that describes how to use those templates. Transplating is done on the developer's computer and the generated html package will be uploaded to the web server. The word "transplating" is a portmanteau from "transform" and "templating", because it transforms one kind of template into another kind of template.
  2. In-browser templating engine is responsible for instantiating the html template elements found in the downloaded documents. In addition to the template elements, the html document contains some parameters for the engine, called "templating program", which is executed by the engine to fill the page with actual data. It is called in-browser because it runs on client side.

Every element in the source document will be copied to the target unchanged, in the same order of appearance, with the following exceptions:

  • placeholders in the child text node of an element, enclosed in braces;
  • placeholders in the start tag of an element, outside attributes (quantifiers);
  • in namespace-aware template documents, the templating namespace;
  • in namespaceless template documents, elements and attributes prefixed t:;
  • shortened templating attributes *, + and ?;
  • behavior annotations, i.e. html attributes prefixed with @.

Related

Wiki: Data Binding Classes
Wiki: Home
Wiki: Placeholders
Wiki: Related Files
Wiki: Templating Attributes
Wiki: Templating Elements
Wiki: Whitespaces