A HTML template must be both valid HTML and valid XML. Hence it should be conform to the XHTML specification.
Your static XHTML web page can be dynamically modified by adding some attributes that will be interpreted by the HTML template code generator, in order to create a dynamic web page that can be interpreted either by your web browser (default), or by the Lavoisier HTML renderer (add "accept=html" in your URL).
In order to be recognized by the code generator, these attributes must belong to the HTML Template Language namespace: http://software.in2p3.fr/lavoisier/template.xsd
For example:
<div xmlns:tpl="http://software.in2p3.fr/lavoisier/template.xsd" tpl:text="'new value'">Example</div>
Almost all attributes of this language (except macros) take a XPath expression as value. A few of them also require a key name, which has to be set in the attribute name, after character ".".
For example:
<div xmlns:tpl="http://software.in2p3.fr/lavoisier/template.xsd" tpl:variable.myVar="'my value'"/>
Any unknown template attribute will be converted to an HTML attribute with the same name.
The short notation with double-braces "{{}}" can be used to set HTML attributes or text. For example, the two following notations are equivalent:
<a tpl:href="XPath1" tpl:text="XPath2"/>
<a href="{{XPath1}}">{{XPath2}}</a>
The macros are evaluated at code generation time. They do not take a XPath as value.
The following attributes generate HTML content:
The following attributes control code execution:
The following attributes remove current HTML node if the XPath argument evaluates to "true":
<a tpl:remove-attribute.href="XPath" href="this may be removed"/>
The following attributes declare variables that can later be used with notation "$myVar":
<div tpl:variable.myVar="XPath">myVar = {{$myVar}}</div>