Here are some examples showing, what can be done now. Let's start from something simple. In OPT, we use curly brackets to put expressions into a text, like:

text text text {$block} text text text

There is also opt:put instruction, which does the same for the first time we see it:

text text text <opt:put value="$block"/> text text text

However, it is an instruction, not curly brackets. It means we can make some nice things with it using attributes. Let's say we want to display something like "Value 1 / Value 2 / Value 3". We will use opt:put, a section and a separator:

<p><opt:put value="$section.value" opt:section="section" str:separator=" / "/></p>

As we see, such section affects also the tag which it was linked to and we can put the values of section elements in the attributes. The separator accepts expressions by default, but if we don't like writing separator="'something'" (double, and then a single quote), we can just switch the namespace to "str".

The implementation of reversed quotes is also ready. Compared to the previous versions, they change their function. Now it is the programmer who can give them a meaning and program them to do what he wants. It can be done by writing a simple function and giving its name to the parser. A sample use is an elegant implementation of language system a'la gettext:

<p>{`Some useful information...`}</p>
<p>{`Author:`} {$author}</p>

This is the last of the changes. As we have an XML compiler, we need some special instructions that allow to manage the tree directly, for example by adding an attribute with a variable name. OPT is going to provide two instructions for this task: opt:tag and opt:attribute. The second one has been already added to the newest dev. We can use it to read the attribute name from the block:

<div>
  <opt:attribute name="$some_name" value="$some_value"/>
  body...
</div>

This is not the end - connected with sections, we get a powerful tool to add a lot of new attributes:

<div>
  <opt:attribute name="$attr.name" value="$attr.value" opt:section="attr"/>
  body...
</div>

If we send the following table to this template: array(0 => array('name' => 'class', 'value' => 'dude'), array('name' => 'id', 'value' => 'lol')), the result will be:

<div class="dude" id="lol">
  body...
</div>

Unfortunately, the English manual is not started yet, but it will be ready before the first stable release.

Download: http://www.invenzzia.org/download/opt-2.0.0-dev3.tar.gz