BASIC RULES

Templates are valid XML files

The Kauri template language is XML-based.

A template file must be a well-formed XML file. So you cannot do things like:

<html>
   <body ${some expr}="value">

   <t:if test="${some expr}">
     </body>
   </t:if>
</html>

The errors in the above snippet are that you can't create dynamic variable names this way, and that the body and t:if elements are not properly nested.

Namespace for template instructions

A simple template might contain just some ${...} expressions, but as soon as you want to use any instructions, you will need to declare the Kauri template namespace, which is:

http://kauriproject.org/template

Here's an example of how to bind the namespace to the "t" prefix and use instructions:

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:t="http://kauriproject.org/template">
  <t:forEach begin="1" end="5" step="2">
    <p>do something</p>
  </t:forEach>
</root>